diff options
author | Jiri Benc <jbenc@redhat.com> | 2015-03-29 10:59:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 13:58:35 -0400 |
commit | 15e318bdc6dfb82914c82fb7ad00badaa8387d8e (patch) | |
tree | b032216e906107641f907389ce3d5f68a0139ab1 /net/ipv6 | |
parent | 8f55db48608b109ad8c7ff4b946ad39b3189a540 (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 'net/ipv6')
-rw-r--r-- | net/ipv6/xfrm6_mode_beet.c | 4 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c index 9949a356d62c..1e205c3253ac 100644 --- a/net/ipv6/xfrm6_mode_beet.c +++ b/net/ipv6/xfrm6_mode_beet.c | |||
@@ -95,8 +95,8 @@ static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb) | |||
95 | 95 | ||
96 | ip6h = ipv6_hdr(skb); | 96 | ip6h = ipv6_hdr(skb); |
97 | ip6h->payload_len = htons(skb->len - size); | 97 | ip6h->payload_len = htons(skb->len - size); |
98 | ip6h->daddr = *(struct in6_addr *)&x->sel.daddr.a6; | 98 | ip6h->daddr = x->sel.daddr.in6; |
99 | ip6h->saddr = *(struct in6_addr *)&x->sel.saddr.a6; | 99 | ip6h->saddr = x->sel.saddr.in6; |
100 | err = 0; | 100 | err = 0; |
101 | out: | 101 | out: |
102 | return err; | 102 | return err; |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 91d934c22a2a..f337a908a76a 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -61,9 +61,7 @@ static int xfrm6_get_saddr(struct net *net, | |||
61 | return -EHOSTUNREACH; | 61 | return -EHOSTUNREACH; |
62 | 62 | ||
63 | dev = ip6_dst_idev(dst)->dev; | 63 | dev = ip6_dst_idev(dst)->dev; |
64 | ipv6_dev_get_saddr(dev_net(dev), dev, | 64 | ipv6_dev_get_saddr(dev_net(dev), dev, &daddr->in6, 0, &saddr->in6); |
65 | (struct in6_addr *)&daddr->a6, 0, | ||
66 | (struct in6_addr *)&saddr->a6); | ||
67 | dst_release(dst); | 65 | dst_release(dst); |
68 | return 0; | 66 | return 0; |
69 | } | 67 | } |