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

- From: David Ahern \<hidden\>
- Date: 2021-02-03 16:01:59 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/02/6257301
- Thread: https://ratatoskr.run/netdev/2021/02/6256035/t.md

```text
On 2/2/21 11:56 AM, Andrea Mayer wrote:
> 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.
```
