]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/ipv6.c
[SCTP]: Trivial sctp endianness annotations.
[linux-2.6-omap-h63xx.git] / net / sctp / ipv6.c
index 249e5033c1a86d7d3d4ec66b20549705a51cf0a2..1f9f5ec0759596ce5543aceccd3159d02ef379e0 100644 (file)
@@ -84,7 +84,7 @@ static struct notifier_block sctp_inet6addr_notifier = {
 
 /* ICMP error handler. */
 SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
-                            int type, int code, int offset, __u32 info)
+                            int type, int code, int offset, __be32 info)
 {
        struct inet6_dev *idev;
        struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
@@ -215,17 +215,17 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
        }
 
        dst = ip6_route_output(NULL, &fl);
-       if (dst) {
+       if (!dst->error) {
                struct rt6_info *rt;
                rt = (struct rt6_info *)dst;
                SCTP_DEBUG_PRINTK(
                        "rt6_dst:" NIP6_FMT " rt6_src:" NIP6_FMT "\n",
                        NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr));
-       } else {
-               SCTP_DEBUG_PRINTK("NO ROUTE\n");
+               return dst;
        }
-
-       return dst;
+       SCTP_DEBUG_PRINTK("NO ROUTE\n");
+       dst_release(dst);
+       return NULL;
 }
 
 /* Returns the number of consecutive initial bits that match in the 2 ipv6
@@ -239,7 +239,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
        int i, j;
 
        for (i = 0; i < 4 ; i++) {
-               __u32 a1xora2;
+               __be32 a1xora2;
 
                a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i];
 
@@ -425,7 +425,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr,
        int length = sizeof(sctp_ipv6addr_param_t);
 
        param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS;
-       param->v6.param_hdr.length = ntohs(length);
+       param->v6.param_hdr.length = htons(length);
        ipv6_addr_copy(&param->v6.addr, &addr->v6.sin6_addr);
 
        return length;