diff mbox series

[net-next,1/6] seg6: Fix TLV definitions

Message ID 1559253021-16772-2-git-send-email-tom@quantonium.net
State Changes Requested
Delegated to: David Miller
Headers show
Series seg6: Segment routing fixes | expand

Commit Message

Tom Herbert May 30, 2019, 9:50 p.m. UTC
The definitions of TLVs in uapi/linux/seg6.h are incorrect and
incomplete. Fix this.

TLV constants are defined for PAD1, PADN, and HMAC (the three defined in
draft-ietf-6man-segment-routing-header-19). The other TLV are unused and
not correct so they are removed.

Signed-off-by: Tom Herbert <tom@quantonium.net>
---
 include/uapi/linux/seg6.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

David Miller May 30, 2019, 10:18 p.m. UTC | #1
From: Tom Herbert <tom@herbertland.com>
Date: Thu, 30 May 2019 14:50:16 -0700

> TLV constants are defined for PAD1, PADN, and HMAC (the three defined in
> draft-ietf-6man-segment-routing-header-19). The other TLV are unused and
> not correct so they are removed.

Removing macros will break userland compilation, you cannot do this.
Tom Herbert May 30, 2019, 11:17 p.m. UTC | #2
On Thu, May 30, 2019 at 3:18 PM David Miller <davem@davemloft.net> wrote:
>
> From: Tom Herbert <tom@herbertland.com>
> Date: Thu, 30 May 2019 14:50:16 -0700
>
> > TLV constants are defined for PAD1, PADN, and HMAC (the three defined in
> > draft-ietf-6man-segment-routing-header-19). The other TLV are unused and
> > not correct so they are removed.
>
> Removing macros will break userland compilation, you cannot do this.

Is it okay to change the value of a uapi macro?

Thanks,
Tom
diff mbox series

Patch

diff --git a/include/uapi/linux/seg6.h b/include/uapi/linux/seg6.h
index 286e8d6..a69ce16 100644
--- a/include/uapi/linux/seg6.h
+++ b/include/uapi/linux/seg6.h
@@ -38,10 +38,8 @@  struct ipv6_sr_hdr {
 #define SR6_FLAG1_ALERT		(1 << 4)
 #define SR6_FLAG1_HMAC		(1 << 3)
 
-#define SR6_TLV_INGRESS		1
-#define SR6_TLV_EGRESS		2
-#define SR6_TLV_OPAQUE		3
-#define SR6_TLV_PADDING		4
+#define SR6_TLV_PAD1		0
+#define SR6_TLV_PADDING		1
 #define SR6_TLV_HMAC		5
 
 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC)