]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/net/llc.h
net: core: limit nested device depth
[mirror_ubuntu-bionic-kernel.git] / include / net / llc.h
index dc35f25eb679d4651b59a20c785005aa0cbb4d0f..df282d9b401704626b1824c70600c993a4ee1bb7 100644 (file)
@@ -66,6 +66,7 @@ struct llc_sap {
        int sk_count;
        struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES];
        struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES];
+       struct rcu_head rcu;
 };
 
 static inline
@@ -116,6 +117,11 @@ static inline void llc_sap_hold(struct llc_sap *sap)
        refcount_inc(&sap->refcnt);
 }
 
+static inline bool llc_sap_hold_safe(struct llc_sap *sap)
+{
+       return refcount_inc_not_zero(&sap->refcnt);
+}
+
 void llc_sap_close(struct llc_sap *sap);
 
 static inline void llc_sap_put(struct llc_sap *sap)