udp: unbreak build lacking CONFIG_XFRM
authorPaolo Abeni <pabeni@redhat.com>
Wed, 26 Jul 2017 09:33:49 +0000 (11:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Jul 2017 16:35:29 +0000 (09:35 -0700)
We must use pre-processor conditional block or suitable accessors to
manipulate skb->sp elsewhere builds lacking the CONFIG_XFRM will break.

Fixes: dce4551cb2ad ("udp: preserve head state for IP_CMSG_PASSSEC")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c

index d243772f6efc91eb2e975fec8f6ff3414b1c52cf..fac7cb9e3b0f7a029f5c89f0670c66481d4a20df 100644 (file)
@@ -1786,7 +1786,7 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
         * the IP options and the cmsg flags, elsewhere can we clear all
         * pending head states while they are hot in the cache
         */
-       if (likely(IPCB(skb)->opt.optlen == 0 && !skb->sp))
+       if (likely(IPCB(skb)->opt.optlen == 0 && !skb_sec_path(skb)))
                skb_release_head_state(skb);
 
        rc = __udp_enqueue_schedule_skb(sk, skb);