packets: Distinguish max Ethernet length with and without VLAN header.
authorBen Pfaff <blp@nicira.com>
Mon, 14 Jul 2008 20:54:27 +0000 (13:54 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 18 Jul 2008 20:42:37 +0000 (13:42 -0700)
include/packets.h

index fac8f414be932da6a537795a865c4f1b3884c509..5d4eb5607a8faaf8356bad2f37d2d69da459ac5f 100644 (file)
@@ -99,8 +99,10 @@ static inline void eth_addr_random(uint8_t ea[ETH_ADDR_LEN])
 
 #define ETH_HEADER_LEN 14
 #define ETH_PAYLOAD_MIN 46
+#define ETH_PAYLOAD_MAX 1500
 #define ETH_TOTAL_MIN (ETH_HEADER_LEN + ETH_PAYLOAD_MIN)
-#define ETH_TOTAL_MAX (ETH_HEADER_LEN + VLAN_HEADER_LEN + 1500)
+#define ETH_TOTAL_MAX (ETH_HEADER_LEN + ETH_PAYLOAD_MAX)
+#define ETH_VLAN_TOTAL_MAX (ETH_HEADER_LEN + VLAN_HEADER_LEN + ETH_PAYLOAD_MAX)
 struct eth_header {
     uint8_t eth_dst[ETH_ADDR_LEN];
     uint8_t eth_src[ETH_ADDR_LEN];