Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfrm: ifdef setsockopt(UDP_ENCAP_ESPINUDP/UDP_ENCAP_ESPINUDP_NON_IKE)

If IPsec is not configured, there is no reason to delay the inevitable.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

authored by

Alexey Dobriyan and committed by
Steffen Klassert
fd1ac07f 4361f5b6

+2 -7
-7
include/net/xfrm.h
··· 1613 1613 { 1614 1614 return -ENOPROTOOPT; 1615 1615 } 1616 - 1617 - static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) 1618 - { 1619 - /* should not happen */ 1620 - kfree_skb(skb); 1621 - return 0; 1622 - } 1623 1616 #endif 1624 1617 1625 1618 struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif,
+2
net/ipv4/udp.c
··· 2520 2520 case UDP_ENCAP: 2521 2521 switch (val) { 2522 2522 case 0: 2523 + #ifdef CONFIG_XFRM 2523 2524 case UDP_ENCAP_ESPINUDP: 2524 2525 case UDP_ENCAP_ESPINUDP_NON_IKE: 2525 2526 up->encap_rcv = xfrm4_udp_encap_rcv; 2527 + #endif 2526 2528 /* FALLTHROUGH */ 2527 2529 case UDP_ENCAP_L2TPINUDP: 2528 2530 up->encap_type = val;