aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-10-10 03:04:37 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-10 14:37:35 -0400
commitb44084c2c822f99dd3f2334b288b7e463d222662 (patch)
tree5fbcaffd319347ee5d22800c231eef2b4c44b007 /net/ipv6
parentba537427d77cf274592f31ce94f4b4cadfad88b4 (diff)
inet: rename ir_loc_port to ir_num
In commit 634fb979e8f ("inet: includes a sock_common in request_sock") I forgot that the two ports in sock_common do not have same byte order : skc_dport is __be16 (network order), but skc_num is __u16 (host order) So sparse complains because ir_loc_port (mapped into skc_num) is considered as __u16 while it should be __be16 Let rename ir_loc_port to ireq->ir_num (analogy with inet->inet_num), and perform appropriate htons/ntohs conversions. Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/inet6_connection_sock.c2
-rw-r--r--net/ipv6/syncookies.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 1317c569b58f..77bb8afb141d 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -83,7 +83,7 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
83 fl6->flowi6_oif = ireq->ir_iif; 83 fl6->flowi6_oif = ireq->ir_iif;
84 fl6->flowi6_mark = sk->sk_mark; 84 fl6->flowi6_mark = sk->sk_mark;
85 fl6->fl6_dport = ireq->ir_rmt_port; 85 fl6->fl6_dport = ireq->ir_rmt_port;
86 fl6->fl6_sport = ireq->ir_loc_port; 86 fl6->fl6_sport = htons(ireq->ir_num);
87 security_req_classify_flow(req, flowi6_to_flowi(fl6)); 87 security_req_classify_flow(req, flowi6_to_flowi(fl6));
88 88
89 dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); 89 dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index bc5698f9e4cd..d04d3f1dd9b7 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -194,7 +194,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
194 194
195 req->mss = mss; 195 req->mss = mss;
196 ireq->ir_rmt_port = th->source; 196 ireq->ir_rmt_port = th->source;
197 ireq->ir_loc_port = th->dest; 197 ireq->ir_num = ntohs(th->dest);
198 ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; 198 ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
199 ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; 199 ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
200 if (ipv6_opt_accepted(sk, skb) || 200 if (ipv6_opt_accepted(sk, skb) ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index db234d609b33..b996ee2005a9 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1735,7 +1735,7 @@ static void get_openreq6(struct seq_file *seq,
1735 i, 1735 i,
1736 src->s6_addr32[0], src->s6_addr32[1], 1736 src->s6_addr32[0], src->s6_addr32[1],
1737 src->s6_addr32[2], src->s6_addr32[3], 1737 src->s6_addr32[2], src->s6_addr32[3],
1738 ntohs(inet_rsk(req)->ir_loc_port), 1738 inet_rsk(req)->ir_num,
1739 dest->s6_addr32[0], dest->s6_addr32[1], 1739 dest->s6_addr32[0], dest->s6_addr32[1],
1740 dest->s6_addr32[2], dest->s6_addr32[3], 1740 dest->s6_addr32[2], dest->s6_addr32[3],
1741 ntohs(inet_rsk(req)->ir_rmt_port), 1741 ntohs(inet_rsk(req)->ir_rmt_port),