X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fxfrm4_policy.c;h=012ef304ce63cddaec800413ef599f72f72ee4b3;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=a05bd39a72c6757a0ed5782b7bec78b45b172b92;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index a05bd39a7..012ef304c 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -12,8 +12,8 @@ #include #include -extern struct dst_ops xfrm4_dst_ops; -extern struct xfrm_policy_afinfo xfrm4_policy_afinfo; +static struct dst_ops xfrm4_dst_ops; +static struct xfrm_policy_afinfo xfrm4_policy_afinfo; static struct xfrm_type_map xfrm4_type_map = { .lock = RW_LOCK_UNLOCKED }; @@ -139,7 +139,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int /* Copy neighbout for reachability confirmation */ dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour); dst_prev->input = rt->u.dst.input; - dst_prev->output = dst_prev->xfrm->type->output; + dst_prev->output = xfrm4_output; if (rt->peer) atomic_inc(&rt->peer->refcnt); x->u.rt.peer = rt->peer; @@ -183,6 +183,15 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) } break; + case IPPROTO_ICMP: + if (pskb_may_pull(skb, xprth + 2 - skb->data)) { + u8 *icmp = xprth; + + fl->fl_icmp_type = icmp[0]; + fl->fl_icmp_code = icmp[1]; + } + break; + case IPPROTO_ESP: if (pskb_may_pull(skb, xprth + 4 - skb->data)) { u32 *ehdr = (u32 *)xprth; @@ -234,7 +243,7 @@ static void xfrm4_update_pmtu(struct dst_entry *dst, u32 mtu) path->ops->update_pmtu(path, mtu); } -struct dst_ops xfrm4_dst_ops = { +static struct dst_ops xfrm4_dst_ops = { .family = AF_INET, .protocol = __constant_htons(ETH_P_IP), .gc = xfrm4_garbage_collect, @@ -243,7 +252,7 @@ struct dst_ops xfrm4_dst_ops = { .entry_size = sizeof(struct xfrm_dst), }; -struct xfrm_policy_afinfo xfrm4_policy_afinfo = { +static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { .family = AF_INET, .lock = RW_LOCK_UNLOCKED, .type_map = &xfrm4_type_map, @@ -254,12 +263,12 @@ struct xfrm_policy_afinfo xfrm4_policy_afinfo = { .decode_session = _decode_session4, }; -void __init xfrm4_policy_init(void) +static void __init xfrm4_policy_init(void) { xfrm_policy_register_afinfo(&xfrm4_policy_afinfo); } -void __exit xfrm4_policy_fini(void) +static void __exit xfrm4_policy_fini(void) { xfrm_policy_unregister_afinfo(&xfrm4_policy_afinfo); } @@ -270,10 +279,3 @@ void __init xfrm4_init(void) xfrm4_policy_init(); } -void __exit xfrm4_fini(void) -{ - //xfrm4_input_fini(); - xfrm4_policy_fini(); - xfrm4_state_fini(); -} -