From: Roy Marples Date: Wed, 5 Feb 2020 14:38:04 +0000 (+0000) Subject: ARP: Recalculate ARP buffer taking into account max frame length X-Git-Tag: v9.0.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87f6681838d8dfadd8ed9fd7995695b4b4ece742;p=thirdparty%2Fdhcpcd.git ARP: Recalculate ARP buffer taking into account max frame length --- diff --git a/src/arp.c b/src/arp.c index 8f5e5c64..8c6acea9 100644 --- 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 diff --git a/src/if.h b/src/if.h index e24a77a3..0656affe 100644 --- 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