changeset 5029:f979cefdddcf draft

ARP: Recalculate ARP buffer taking into account max frame length
author Roy Marples <roy@marples.name>
date Wed, 05 Feb 2020 14:38:04 +0000
parents c06163d3bc14
children d58699a706b7
files src/arp.c src/if.h
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/arp.c	Wed Feb 05 14:05:51 2020 +0000
+++ b/src/arp.c	Wed Feb 05 14:38:04 2020 +0000
@@ -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
--- a/src/if.h	Wed Feb 05 14:05:51 2020 +0000
+++ b/src/if.h	Wed Feb 05 14:38:04 2020 +0000
@@ -92,7 +92,8 @@
 
 /* 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