[SCTP]: Pass net-endian to ->get_dst().
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Nov 2006 01:13:01 +0000 (17:13 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:26:53 +0000 (21:26 -0800)
all instances are actually endian-agnostic...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/transport.c

index 74faa1b6dbfe3572b397eccdce4d19b3cf82a400..33e7d85f1119f6f7ea3e0d4ec6b99bf9cbbb5f02 100644 (file)
@@ -234,7 +234,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
 {
        struct dst_entry *dst;
 
-       dst = transport->af_specific->get_dst(NULL, &transport->ipaddr_h, NULL);
+       dst = transport->af_specific->get_dst(NULL, &transport->ipaddr, NULL);
 
        if (dst) {
                transport->pathmtu = dst_mtu(dst);
@@ -251,16 +251,18 @@ void sctp_transport_route(struct sctp_transport *transport,
 {
        struct sctp_association *asoc = transport->asoc;
        struct sctp_af *af = transport->af_specific;
-       union sctp_addr *daddr = &transport->ipaddr_h;
+       union sctp_addr *daddr = &transport->ipaddr;
        struct dst_entry *dst;
+       union sctp_addr tmp;
+       flip_to_n(&tmp, saddr);
 
-       dst = af->get_dst(asoc, daddr, saddr);
+       dst = af->get_dst(asoc, daddr, &tmp);
 
        if (saddr) {
                memcpy(&transport->saddr_h, saddr, sizeof(union sctp_addr));
                flip_to_n(&transport->saddr, &transport->saddr_h);
        } else {
-               af->get_saddr(asoc, dst, &transport->ipaddr, &transport->saddr);
+               af->get_saddr(asoc, dst, daddr, &transport->saddr);
                flip_to_h(&transport->saddr_h, &transport->saddr);
        }