summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 17:12:41 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:26:52 -0800
commitd3f7a54a295f2ffc9033b425c6538a7e9d7fbe8a (patch)
treea6f32788e62edc9e29194684334e41db50119f1c /net/sctp
parent6a1e5f335461567f593e88b218f1c06817cbd323 (diff)
[SCTP]: ->get_saddr() switched to net-endian.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/ipv6.c4
-rw-r--r--net/sctp/protocol.c2
-rw-r--r--net/sctp/transport.c10
3 files changed, 9 insertions, 7 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 566cdc9977c4..7f4c5bafea14 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -292,9 +292,9 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
if ((laddr->use_as_src) &&
(laddr->a_h.sa.sa_family == AF_INET6) &&
(scope <= sctp_scope(&laddr->a_h))) {
- bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a_h);
+ bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
if (!baddr || (matchlen < bmatchlen)) {
- baddr = &laddr->a_h;
+ baddr = &laddr->a;
matchlen = bmatchlen;
}
}
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 87d36f440d1d..5b8b7f3598e0 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -539,7 +539,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc,
if (rt) {
saddr->v4.sin_family = AF_INET;
- saddr->v4.sin_port = asoc->base.bind_addr.port;
+ saddr->v4.sin_port = htons(asoc->base.bind_addr.port);
saddr->v4.sin_addr.s_addr = rt->rt_src;
}
}
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index e1448addcd93..74faa1b6dbfe 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -256,11 +256,13 @@ void sctp_transport_route(struct sctp_transport *transport,
dst = af->get_dst(asoc, daddr, saddr);
- if (saddr)
+ if (saddr) {
memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr));
- else
- af->get_saddr(asoc, dst, daddr, &transport->saddr_h);
- flip_to_n(&transport->saddr, &transport->saddr_h);
+ flip_to_n(&transport->saddr, &transport->saddr_h);
+ } else {
+ af->get_saddr(asoc, dst, &transport->ipaddr, &transport->saddr);
+ flip_to_h(&transport->saddr_h, &transport->saddr);
+ }
transport->dst = dst;
if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {