aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inetpeer.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2015-03-29 10:59:23 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 13:58:35 -0400
commit8f55db48608b109ad8c7ff4b946ad39b3189a540 (patch)
treeb7364235d94c0e15aa491858a4a574182292f5e1 /include/net/inetpeer.h
parentf0ef31264cde8b489a0b87149ebc3a72cef4c58a (diff)
tcp: simplify inetpeer_addr_base use
In many places, the a6 field is typecasted to struct in6_addr. As the fields are in union anyway, just add in6_addr type to the union and get rid of the typecasting. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inetpeer.h')
-rw-r--r--include/net/inetpeer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 80479abddf73..d5332ddcea3f 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -19,6 +19,7 @@ struct inetpeer_addr_base {
19 union { 19 union {
20 __be32 a4; 20 __be32 a4;
21 __be32 a6[4]; 21 __be32 a6[4];
22 struct in6_addr in6;
22 }; 23 };
23}; 24};
24 25
@@ -151,7 +152,7 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
151{ 152{
152 struct inetpeer_addr daddr; 153 struct inetpeer_addr daddr;
153 154
154 *(struct in6_addr *)daddr.addr.a6 = *v6daddr; 155 daddr.addr.in6 = *v6daddr;
155 daddr.family = AF_INET6; 156 daddr.family = AF_INET6;
156 return inet_getpeer(base, &daddr, create); 157 return inet_getpeer(base, &daddr, create);
157} 158}