Thread (4 messages) flat view 4 messages, 2 authors, 2021-02-04

Re: [PATCH net-next] seg6: fool-proof the processing of SRv6 behavior attributes

From: David Ahern <hidden>
Date: 2021-02-03 16:01:59
Also in: lkml

On 2/2/21 11:56 AM, Andrea Mayer wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index b07f7c1c82a4..7cc50d506902 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -31,6 +31,9 @@
 #include <linux/etherdevice.h>
 #include <linux/bpf.h>
 
+#define SEG6_F_ATTR(i)		BIT(i)
+#define SEG6_LOCAL_MAX_SUPP	32
+
SEG6_LOCAL_MAX_SUPP should not be needed; it can be derived from the type:

    BUILD_BUG_ON(BITS_PER_TYPE(unsigned long) > SEG6_LOCAL_MAX)

The use of BIT() looks fine.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help