Skip to contentSkip to conversation

net: Swap ver and type in pppoe_hdr

PATCH Applied Changli Gao 2 participants 2 messages Jun 28, 2013 – Jul 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Swap ver and type in pppoe_hdr

Ver and type in pppoe_hdr should be swapped as defined by RFC2516 section-4.

---
 include/uapi/linux/if_pppox.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/if_pppox.h +2 -2
index 0b46fd5..e36a4ae 100644
@@ -135,11 +135,11 @@ struct pppoe_tag {
 
 struct pppoe_hdr {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
-	__u8 ver : 4;
 	__u8 type : 4;
+	__u8 ver : 4;
 #elif defined(__BIG_ENDIAN_BITFIELD)
-	__u8 type : 4;
 	__u8 ver : 4;
+	__u8 type : 4;
 #else
 #error	"Please fix <asm/byteorder.h>"
 #endif
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw

From: Changli Gao <[email protected]>
Date: Sat, 29 Jun 2013 00:15:51 +0800

Quoted 2 lines

Ver and type in pppoe_hdr should be swapped as defined by RFC2516 section-4.

I can't believe this has been wrong for more than 8 years.

But, of course, it is possible. Especially since we never check these 'ver' and 'type' fields on packet input, and we always set them both to the same value ('1') on output.

Applied, thanks.