summaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2015-03-29 10:59:24 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 13:58:35 -0400
commit15e318bdc6dfb82914c82fb7ad00badaa8387d8e (patch)
treeb032216e906107641f907389ce3d5f68a0139ab1 /include/net/xfrm.h
parent8f55db48608b109ad8c7ff4b946ad39b3189a540 (diff)
xfrm: simplify xfrm_address_t 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. Modifying the uapi header is okay, the union has still the same size. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index d0ac7d7be8a7..461f83539493 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1025,7 +1025,7 @@ xfrm_addr_any(const xfrm_address_t *addr, unsigned short family)
1025 case AF_INET: 1025 case AF_INET:
1026 return addr->a4 == 0; 1026 return addr->a4 == 0;
1027 case AF_INET6: 1027 case AF_INET6:
1028 return ipv6_addr_any((struct in6_addr *)&addr->a6); 1028 return ipv6_addr_any(&addr->in6);
1029 } 1029 }
1030 return 0; 1030 return 0;
1031} 1031}
@@ -1238,8 +1238,8 @@ void xfrm_flowi_addr_get(const struct flowi *fl,
1238 memcpy(&daddr->a4, &fl->u.ip4.daddr, sizeof(daddr->a4)); 1238 memcpy(&daddr->a4, &fl->u.ip4.daddr, sizeof(daddr->a4));
1239 break; 1239 break;
1240 case AF_INET6: 1240 case AF_INET6:
1241 *(struct in6_addr *)saddr->a6 = fl->u.ip6.saddr; 1241 saddr->in6 = fl->u.ip6.saddr;
1242 *(struct in6_addr *)daddr->a6 = fl->u.ip6.daddr; 1242 daddr->in6 = fl->u.ip6.daddr;
1243 break; 1243 break;
1244 } 1244 }
1245} 1245}