aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index c435620dbb37..bed7d43932f6 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1045,6 +1045,23 @@ xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family)
1045 return NULL; 1045 return NULL;
1046} 1046}
1047 1047
1048static __inline__
1049void xfrm_flowi_addr_get(struct flowi *fl,
1050 xfrm_address_t *saddr, xfrm_address_t *daddr,
1051 unsigned short family)
1052{
1053 switch(family) {
1054 case AF_INET:
1055 memcpy(&saddr->a4, &fl->fl4_src, sizeof(saddr->a4));
1056 memcpy(&daddr->a4, &fl->fl4_dst, sizeof(daddr->a4));
1057 break;
1058 case AF_INET6:
1059 ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->fl6_src);
1060 ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->fl6_dst);
1061 break;
1062 }
1063}
1064
1048static __inline__ int 1065static __inline__ int
1049__xfrm4_state_addr_check(struct xfrm_state *x, 1066__xfrm4_state_addr_check(struct xfrm_state *x,
1050 xfrm_address_t *daddr, xfrm_address_t *saddr) 1067 xfrm_address_t *daddr, xfrm_address_t *saddr)