Lines Matching refs:x
52 struct xfrm_state *x; in ipcomp6_err() local
59 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, in ipcomp6_err()
61 if (!x) in ipcomp6_err()
69 xfrm_state_put(x); in ipcomp6_err()
75 static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x) in ipcomp6_tunnel_create() argument
77 struct net *net = xs_net(x); in ipcomp6_tunnel_create()
86 t->id.spi = xfrm6_tunnel_alloc_spi(net, (xfrm_address_t *)&x->props.saddr); in ipcomp6_tunnel_create()
90 memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); in ipcomp6_tunnel_create()
91 memcpy(&t->sel, &x->sel, sizeof(t->sel)); in ipcomp6_tunnel_create()
93 t->props.mode = x->props.mode; in ipcomp6_tunnel_create()
94 memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr)); in ipcomp6_tunnel_create()
95 memcpy(&t->mark, &x->mark, sizeof(t->mark)); in ipcomp6_tunnel_create()
96 t->if_id = x->if_id; in ipcomp6_tunnel_create()
113 static int ipcomp6_tunnel_attach(struct xfrm_state *x) in ipcomp6_tunnel_attach() argument
115 struct net *net = xs_net(x); in ipcomp6_tunnel_attach()
119 u32 mark = x->mark.m & x->mark.v; in ipcomp6_tunnel_attach()
121 spi = xfrm6_tunnel_spi_lookup(net, (xfrm_address_t *)&x->props.saddr); in ipcomp6_tunnel_attach()
123 t = xfrm_state_lookup(net, mark, (xfrm_address_t *)&x->id.daddr, in ipcomp6_tunnel_attach()
126 t = ipcomp6_tunnel_create(x); in ipcomp6_tunnel_attach()
134 x->tunnel = t; in ipcomp6_tunnel_attach()
141 static int ipcomp6_init_state(struct xfrm_state *x, in ipcomp6_init_state() argument
146 x->props.header_len = 0; in ipcomp6_init_state()
147 switch (x->props.mode) { in ipcomp6_init_state()
151 x->props.header_len += sizeof(struct ipv6hdr); in ipcomp6_init_state()
158 err = ipcomp_init_state(x, extack); in ipcomp6_init_state()
162 if (x->props.mode == XFRM_MODE_TUNNEL) { in ipcomp6_init_state()
163 err = ipcomp6_tunnel_attach(x); in ipcomp6_init_state()