Lines Matching refs:sp
96 void __secpath_destroy(struct sec_path *sp) in __secpath_destroy() argument
99 for (i = 0; i < sp->len; i++) in __secpath_destroy()
100 xfrm_state_put(sp->xvec[i]); in __secpath_destroy()
101 kmem_cache_free(secpath_cachep, sp); in __secpath_destroy()
107 struct sec_path *sp; in secpath_dup() local
109 sp = kmem_cache_alloc(secpath_cachep, GFP_ATOMIC); in secpath_dup()
110 if (!sp) in secpath_dup()
113 sp->len = 0; in secpath_dup()
117 memcpy(sp, src, sizeof(*sp)); in secpath_dup()
118 for (i = 0; i < sp->len; i++) in secpath_dup()
119 xfrm_state_hold(sp->xvec[i]); in secpath_dup()
121 atomic_set(&sp->refcnt, 1); in secpath_dup()
122 return sp; in secpath_dup()
222 if (!skb->sp || atomic_read(&skb->sp->refcnt) != 1) { in xfrm_input()
223 struct sec_path *sp; in xfrm_input() local
225 sp = secpath_dup(skb->sp); in xfrm_input()
226 if (!sp) { in xfrm_input()
230 if (skb->sp) in xfrm_input()
231 secpath_put(skb->sp); in xfrm_input()
232 skb->sp = sp; in xfrm_input()
242 if (skb->sp->len == XFRM_MAX_DEPTH) { in xfrm_input()
254 skb->sp->xvec[skb->sp->len++] = x; in xfrm_input()