net: tls: make the offload check helper take skb not socket
[linux-2.6-microblaze.git] / include / net / tls.h
index b7d0f1e..5e71dd3 100644 (file)
@@ -370,10 +370,12 @@ struct sk_buff *
 tls_validate_xmit_skb_sw(struct sock *sk, struct net_device *dev,
                         struct sk_buff *skb);
 
-static inline bool tls_is_sk_tx_device_offloaded(struct sock *sk)
+static inline bool tls_is_skb_tx_device_offloaded(const struct sk_buff *skb)
 {
-#ifdef CONFIG_SOCK_VALIDATE_XMIT
-       return sk_fullsock(sk) &&
+#ifdef CONFIG_TLS_DEVICE
+       struct sock *sk = skb->sk;
+
+       return sk && sk_fullsock(sk) &&
               (smp_load_acquire(&sk->sk_validate_xmit_skb) ==
               &tls_validate_xmit_skb);
 #else