STATE: Common receive function for route optimization extension headers.
Subsystems (4)
PATCH 11/23 STATE: Common receive function for route optimization extension headers.
XFRM_STATE_WILDRECV flag is introduced; the last resort state is set it and receives packet which is not route optimized but uses such extension headers i.e. Mobile IPv6 signaling (binding update and acknowledgement). A node enabled Mobile IPv6 adds the state.
Based on MIPL2 kernel patch.
--- include/linux/xfrm.h | 1 include/net/xfrm.h | 10 ++++ net/ipv6/ipv6_syms.c | 3 + net/ipv6/xfrm6_input.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++ net/xfrm/xfrm_state.c | 3 + 5 files changed, 129 insertions(+), 0 deletions(-)
include/linux/xfrm.h +1 -0
@@ -256,6 +256,7 @@ struct xfrm_usersa_info {#define XFRM_STATE_NOECN 1#define XFRM_STATE_DECAP_DSCP 2#define XFRM_STATE_NOPMTUDISC 4 +#define XFRM_STATE_WILDRECV 8 };struct xfrm_usersa_id {
include/net/xfrm.h +10 -0
@@ -964,6 +964,16 @@ extern int xfrm4_tunnel_register(structextern int xfrm4_tunnel_deregister (struct xfrm_tunnel *handler);extern int xfrm6_rcv_spi (struct sk_buff *skb,u32 spi);extern int xfrm6_rcv (struct sk_buff **pskb); +#ifdef CONFIG_XFRM_ADVANCED +extern int __xfrm6_rcv_one (struct sk_buff *skb,xfrm_address_t *daddr, +xfrm_address_t *saddr,u8 proto); +#else +static inline int __xfrm6_rcv_one (struct sk_buff *skb,xfrm_address_t *daddr, +xfrm_address_t *saddr,u8 proto) +{ +return -ENOSYS ; +} +#endif extern int xfrm6_tunnel_register (struct xfrm6_tunnel *handler);extern int xfrm6_tunnel_deregister (struct xfrm6_tunnel *handler);extern u32 xfrm6_tunnel_alloc_spi (xfrm_address_t *saddr);
net/ipv6/ipv6_syms.c +3 -0
@@ -32,6 +32,9 @@ EXPORT_SYMBOL(ipv6_chk_addr);EXPORT_SYMBOL (in6_dev_finish_destroy);#ifdef CONFIG_XFRM EXPORT_SYMBOL (xfrm6_rcv); +#ifdef CONFIG_XFRM_ADVANCED +EXPORT_SYMBOL (__xfrm6_rcv_one); +#endif #endif EXPORT_SYMBOL (rt6_lookup);EXPORT_SYMBOL (ipv6_push_nfrag_opts);
net/ipv6/xfrm6_input.c +112 -0
115 lines not on this page · raw message
net/xfrm/xfrm_state.c +3 -0
@@ -357,6 +357,9 @@ xfrm_state_find(xfrm_address_t *daddr, xlist_for_each_entry (x, xfrm_state_bydst+h, bydst) { if (x->props.family == family && x->props.reqid == tmpl->reqid && +#ifdef CONFIG_XFRM_ADVANCED + (x->props.flags & XFRM_STATE_WILDRECV) == 0 && +#endif xfrm_state_addr_check(x, daddr, saddr, family) && tmpl->mode == x->props.mode && tmpl->id.proto == x->id.proto &&
Signature · 1 line
1.4.1