equal
deleted
inserted
replaced
61 |
61 |
62 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) |
62 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) |
63 return; |
63 return; |
64 |
64 |
65 spi = htonl(ntohs(ipcomph->cpi)); |
65 spi = htonl(ntohs(ipcomph->cpi)); |
66 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); |
66 x = xfrm_state_lookup(&init_net, (xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); |
67 if (!x) |
67 if (!x) |
68 return; |
68 return; |
69 |
69 |
70 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" NIP6_FMT "\n", |
70 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI6\n", |
71 spi, NIP6(iph->daddr)); |
71 spi, &iph->daddr); |
72 xfrm_state_put(x); |
72 xfrm_state_put(x); |
73 } |
73 } |
74 |
74 |
75 static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x) |
75 static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x) |
76 { |
76 { |
77 struct xfrm_state *t = NULL; |
77 struct xfrm_state *t = NULL; |
78 |
78 |
79 t = xfrm_state_alloc(); |
79 t = xfrm_state_alloc(&init_net); |
80 if (!t) |
80 if (!t) |
81 goto out; |
81 goto out; |
82 |
82 |
83 t->id.proto = IPPROTO_IPV6; |
83 t->id.proto = IPPROTO_IPV6; |
84 t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); |
84 t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); |
112 struct xfrm_state *t = NULL; |
112 struct xfrm_state *t = NULL; |
113 __be32 spi; |
113 __be32 spi; |
114 |
114 |
115 spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr); |
115 spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr); |
116 if (spi) |
116 if (spi) |
117 t = xfrm_state_lookup((xfrm_address_t *)&x->id.daddr, |
117 t = xfrm_state_lookup(&init_net, (xfrm_address_t *)&x->id.daddr, |
118 spi, IPPROTO_IPV6, AF_INET6); |
118 spi, IPPROTO_IPV6, AF_INET6); |
119 if (!t) { |
119 if (!t) { |
120 t = ipcomp6_tunnel_create(x); |
120 t = ipcomp6_tunnel_create(x); |
121 if (!t) { |
121 if (!t) { |
122 err = -EINVAL; |
122 err = -EINVAL; |