Skip to contentSkip to conversation

net: fix vlan validation

PATCH New Stefan Agner 2 participants 3 messages Apr 12, 2016 – Apr 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: fix vlan validation

VLAN identifiers are 12-bit decimal numbers, not IP addresses.

---

 include/env_flags.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/env_flags.h +2 -2
index 9e87e1b..0dcec06 100644
@@ -57,8 +57,8 @@ enum env_flags_varaccess {
 	"gatewayip:i," \
 	"netmask:i," \
 	"serverip:i," \
-	"nvlan:i," \
-	"vlan:i," \
+	"nvlan:d," \
+	"vlan:d," \
 	"dnsip:i,"
 #else
 #define ETHADDR_FLAGS
Signature · 1 line
2.8.0
#1 lore raw

PATCH 2/2 net: increase maximum frame size to accomediate VLAN packets

Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522 bytes long. Increase the default size used to allocate packet storage by 4 bytes.

---

 include/net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net.h +1 -1
index 1fb4194..a97e530 100644
@@ -476,7 +476,7 @@ struct icmp_hdr {
  * maximum packet size =  1518
  * maximum packet size and multiple of 32 bytes =  1536
  */
-#define PKTSIZE			1518
+#define PKTSIZE			1522
 #define PKTSIZE_ALIGN		1536
 /*#define PKTSIZE		608*/
 
Signature · 1 line
2.8.0
#2 lore raw

PATCH 2/2 net: increase maximum frame size to accomediate VLAN packets

Quoted 15 lines · Stefan Agner

Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522 bytes long. Increase the default size used to allocate packet storage by 4 bytes.

---

 include/net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net.h +0 -0
index 1fb4194..a97e530 100644

include/net.h struct icmp_hdr { · line 476

Quoted 1 line
include/net.h +0 -0
@@ -476,7 +476,7 @@ struct icmp_hdr {
  * maximum packet size =  1518

This comment is now wrong too, please update or maybe add:
* maximum packet size and VLAN header = 1522

Quoted 14 lines
include/net.h +1 -1
  * maximum packet size and multiple of 32 bytes =  1536
  */
-#define PKTSIZE			1518
+#define PKTSIZE			1522
 #define PKTSIZE_ALIGN		1536
 /*#define PKTSIZE		608*/
 
Signature · 6 lines
2.8.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160413/2398ddda/attachment.sig>