Browse Source

[netdevice] Fix incorrect value for MAX_LL_HEADER_LEN

MAX_LL_HEADER_LEN is erroneously set to 6 rather than 14, resulting
in possible data corruption whenever we send an ARP packet.

Fix value and add a comment explaining why MAX_LL_ADDR_LEN is greater
than MAX_LL_HEADER_LEN.

Reported-by: Joshua Oreman <oremanj@rwcr.net>
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
edfbd4e4fa
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      src/include/gpxe/netdevice.h

+ 11
- 3
src/include/gpxe/netdevice.h View File

21
 struct ll_protocol;
21
 struct ll_protocol;
22
 struct device;
22
 struct device;
23
 
23
 
24
-/** Maximum length of a link-layer address */
24
+/** Maximum length of a link-layer address
25
+ *
26
+ * The longest currently-supported link-layer address is for IPoIB.
27
+ */
25
 #define MAX_LL_ADDR_LEN 20
28
 #define MAX_LL_ADDR_LEN 20
26
 
29
 
27
-/** Maximum length of a link-layer header */
28
-#define MAX_LL_HEADER_LEN 6
30
+/** Maximum length of a link-layer header
31
+ *
32
+ * The longest currently-supported link-layer header is for Ethernet.
33
+ * (The IPoIB link-layer pseudo-header doesn't actually include
34
+ * link-layer addresses; see ipoib.c for details).
35
+ */
36
+#define MAX_LL_HEADER_LEN 14
29
 
37
 
30
 /** Maximum length of a network-layer address */
38
 /** Maximum length of a network-layer address */
31
 #define MAX_NET_ADDR_LEN 4
39
 #define MAX_NET_ADDR_LEN 4

Loading…
Cancel
Save