Patchwork net: Swap ver and type in pppoe_hdr

login
register
mail settings
Submitter Changli Gao
Date June 28, 2013, 4:15 p.m.
Message ID <1372436151-61527-1-git-send-email-xiaosuo@gmail.com>
Download mbox | patch
Permalink /patch/255462/
State Accepted
Delegated to: David Miller
Headers show

Comments

Changli Gao - June 28, 2013, 4:15 p.m.
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(-)
David Miller - July 2, 2013, 1:20 a.m.
From: Changli Gao <xiaosuo@gmail.com>
Date: Sat, 29 Jun 2013 00:15:51 +0800

> 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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index 0b46fd5..e36a4ae 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -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