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>
This commit is contained in:
Jiri Benc
2015-03-29 16:59:24 +02:00
committed by David S. Miller
부모 8f55db4860
커밋 15e318bdc6
6개의 변경된 파일13개의 추가작업 그리고 13개의 파일을 삭제

파일 보기

@@ -1043,12 +1043,12 @@ static struct xfrm_state *__find_acq_core(struct net *net,
break;
case AF_INET6:
*(struct in6_addr *)x->sel.daddr.a6 = *(struct in6_addr *)daddr;
*(struct in6_addr *)x->sel.saddr.a6 = *(struct in6_addr *)saddr;
x->sel.daddr.in6 = daddr->in6;
x->sel.saddr.in6 = saddr->in6;
x->sel.prefixlen_d = 128;
x->sel.prefixlen_s = 128;
*(struct in6_addr *)x->props.saddr.a6 = *(struct in6_addr *)saddr;
*(struct in6_addr *)x->id.daddr.a6 = *(struct in6_addr *)daddr;
x->props.saddr.in6 = saddr->in6;
x->id.daddr.in6 = daddr->in6;
break;
}