[SCTP]: sctp_process_init() and sctp_source() switched to net-endian.
[deliverable/linux.git] / net / sctp / ipv6.c
index 1f9f5ec0759596ce5543aceccd3159d02ef379e0..566cdc9977c48878c7621db43b9141c14d1ee34b 100644 (file)
@@ -161,17 +161,17 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
        /* Fill in the dest address from the route entry passed with the skb
         * and the source address from the transport.
         */
-       ipv6_addr_copy(&fl.fl6_dst, &transport->ipaddr.v6.sin6_addr);
-       ipv6_addr_copy(&fl.fl6_src, &transport->saddr.v6.sin6_addr);
+       ipv6_addr_copy(&fl.fl6_dst, &transport->ipaddr_h.v6.sin6_addr);
+       ipv6_addr_copy(&fl.fl6_src, &transport->saddr_h.v6.sin6_addr);
 
        fl.fl6_flowlabel = np->flow_label;
        IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
        if (ipv6_addr_type(&fl.fl6_src) & IPV6_ADDR_LINKLOCAL)
-               fl.oif = transport->saddr.v6.sin6_scope_id;
+               fl.oif = transport->saddr_h.v6.sin6_scope_id;
        else
                fl.oif = sk->sk_bound_dev_if;
        fl.fl_ip_sport = inet_sk(sk)->sport;
-       fl.fl_ip_dport = transport->ipaddr.v6.sin6_port;
+       fl.fl_ip_dport = transport->ipaddr_h.v6.sin6_port;
 
        if (np->opt && np->opt->srcrt) {
                struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
@@ -290,11 +290,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
        list_for_each(pos, &bp->address_list) {
                laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
                if ((laddr->use_as_src) &&
-                   (laddr->a.sa.sa_family == AF_INET6) &&
-                   (scope <= sctp_scope(&laddr->a))) {
-                       bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
+                   (laddr->a_h.sa.sa_family == AF_INET6) &&
+                   (scope <= sctp_scope(&laddr->a_h))) {
+                       bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a_h);
                        if (!baddr || (matchlen < bmatchlen)) {
-                               baddr = &laddr->a;
+                               baddr = &laddr->a_h;
                                matchlen = bmatchlen;
                        }
                }
@@ -336,6 +336,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
                        addr->a.v6.sin6_port = 0;
                        addr->a.v6.sin6_addr = ifp->addr;
                        addr->a.v6.sin6_scope_id = dev->ifindex;
+                       addr->a_h = addr->a;
                        INIT_LIST_HEAD(&addr->list);
                        list_add_tail(&addr->list, addrlist);
                }
@@ -350,7 +351,7 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb,
                             int is_saddr)
 {
        void *from;
-       __u16 *port;
+       __be16 *port;
        struct sctphdr *sh;
 
        port = &addr->v6.sin6_port;
@@ -360,10 +361,10 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb,
 
        sh = (struct sctphdr *) skb->h.raw;
        if (is_saddr) {
-               *port  = ntohs(sh->source);
+               *port  = sh->source;
                from = &skb->nh.ipv6h->saddr;
        } else {
-               *port = ntohs(sh->dest);
+               *port = sh->dest;
                from = &skb->nh.ipv6h->daddr;
        }
        ipv6_addr_copy(&addr->v6.sin6_addr, from);
@@ -407,7 +408,7 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
 /* Initialize a sctp_addr from an address parameter. */
 static void sctp_v6_from_addr_param(union sctp_addr *addr,
                                    union sctp_addr_param *param,
-                                   __u16 port, int iif)
+                                   __be16 port, int iif)
 {
        addr->v6.sin6_family = AF_INET6;
        addr->v6.sin6_port = port;
@@ -433,7 +434,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr,
 
 /* Initialize a sctp_addr from a dst_entry. */
 static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst,
-                             unsigned short port)
+                             __be16 port)
 {
        struct rt6_info *rt = (struct rt6_info *)dst;
        addr->sa.sa_family = AF_INET6;
This page took 0.029127 seconds and 5 git commands to generate.