mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
f0ef31264c
commit
8f55db4860
2 changed files with 10 additions and 15 deletions
|
@ -19,6 +19,7 @@ struct inetpeer_addr_base {
|
|||
union {
|
||||
__be32 a4;
|
||||
__be32 a6[4];
|
||||
struct in6_addr in6;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -151,7 +152,7 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
|
|||
{
|
||||
struct inetpeer_addr daddr;
|
||||
|
||||
*(struct in6_addr *)daddr.addr.a6 = *v6daddr;
|
||||
daddr.addr.in6 = *v6daddr;
|
||||
daddr.family = AF_INET6;
|
||||
return inet_getpeer(base, &daddr, create);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue