]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ARP: Recalculate ARP buffer taking into account max frame length
authorRoy Marples <roy@marples.name>
Wed, 5 Feb 2020 14:38:04 +0000 (14:38 +0000)
committerRoy Marples <roy@marples.name>
Wed, 5 Feb 2020 14:38:04 +0000 (14:38 +0000)
src/arp.c
src/if.h

index 8f5e5c64f1598a39225104b4830325dbe6eeac57..8c6acea90c4770efce3de54df6cb92f1339356f4 100644 (file)
--- a/src/arp.c
+++ b/src/arp.c
@@ -56,8 +56,9 @@
 #include "privsep.h"
 
 #if defined(ARP)
-#define ARP_LEN                                                                      \
-       (sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
+#define ARP_LEN                                                                \
+       (FRAMEHDRLEN_MAX +                                              \
+        sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
 
 /* ARP debugging can be quite noisy. Enable this for more noise! */
 //#define      ARP_DEBUG
index e24a77a307147b804e21543a2c1fdd8e339d3ee7..0656affe858e57463777bd9e7bad17022d4c4176 100644 (file)
--- a/src/if.h
+++ b/src/if.h
@@ -92,7 +92,8 @@ typedef unsigned long         ioctl_request_t;
 
 /* Maximum frame length.
  * Support jumbo frames and some extra. */
-#define        FRAMELEN_MAX                    10240
+#define        FRAMEHDRLEN_MAX                 14      /* only ethernet support */
+#define        FRAMELEN_MAX                    (FRAMEHDRLEN_MAX + 9216)
 
 /* Work out if we have a private address or not
  * 10/8