Commit d3f7a54a authored by Al Viro's avatar Al Viro Committed by David S. Miller

[SCTP]: ->get_saddr() switched to net-endian.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a1e5f33
...@@ -292,9 +292,9 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc, ...@@ -292,9 +292,9 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
if ((laddr->use_as_src) && if ((laddr->use_as_src) &&
(laddr->a_h.sa.sa_family == AF_INET6) && (laddr->a_h.sa.sa_family == AF_INET6) &&
(scope <= sctp_scope(&laddr->a_h))) { (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)) { if (!baddr || (matchlen < bmatchlen)) {
baddr = &laddr->a_h; baddr = &laddr->a;
matchlen = bmatchlen; matchlen = bmatchlen;
} }
} }
......
...@@ -539,7 +539,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc, ...@@ -539,7 +539,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc,
if (rt) { if (rt) {
saddr->v4.sin_family = AF_INET; 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; saddr->v4.sin_addr.s_addr = rt->rt_src;
} }
} }
......
...@@ -256,11 +256,13 @@ void sctp_transport_route(struct sctp_transport *transport, ...@@ -256,11 +256,13 @@ void sctp_transport_route(struct sctp_transport *transport,
dst = af->get_dst(asoc, daddr, saddr); dst = af->get_dst(asoc, daddr, saddr);
if (saddr) if (saddr) {
memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr)); memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr));
else flip_to_n(&transport->saddr, &transport->saddr_h);
af->get_saddr(asoc, dst, daddr, &transport->saddr_h); } else {
flip_to_n(&transport->saddr, &transport->saddr_h); af->get_saddr(asoc, dst, &transport->ipaddr, &transport->saddr);
flip_to_h(&transport->saddr_h, &transport->saddr);
}
transport->dst = dst; transport->dst = dst;
if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment