OSDN Git Service

net: skb: change the definition SKB_DR_SET()
authorMenglong Dong <imagedong@tencent.com>
Fri, 13 May 2022 03:03:38 +0000 (11:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:47:43 +0000 (10:47 +0100)
The SKB_DR_OR() is used to set the drop reason to a value when it is
not set or specified yet. SKB_NOT_DROPPED_YET should also be considered
as not set.

Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Hao Peng <flyingpeng@tencent.com>
Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h

index 9d82a8b..5a2b29d 100644 (file)
@@ -510,7 +510,8 @@ enum skb_drop_reason {
        (name = SKB_DROP_REASON_##reason)
 #define SKB_DR_OR(name, reason)                                        \
        do {                                                    \
-               if (name == SKB_DROP_REASON_NOT_SPECIFIED)      \
+               if (name == SKB_DROP_REASON_NOT_SPECIFIED ||    \
+                   name == SKB_NOT_DROPPED_YET)                \
                        SKB_DR_SET(name, reason);               \
        } while (0)