]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP: Support jumbo frames
authorRoy Marples <roy@marples.name>
Wed, 5 Feb 2020 14:05:51 +0000 (14:05 +0000)
committerRoy Marples <roy@marples.name>
Wed, 5 Feb 2020 14:05:51 +0000 (14:05 +0000)
Also important as we now need to store the frame header in the
initial buffer.

src/dhcp.c
src/if.h
src/privsep-bpf.c

index 46e7d0a1eca9c1ebce16d69945025d169937b4af..ab0e01912016821dd2575953bc3595be614322a1 100644 (file)
@@ -3507,7 +3507,7 @@ static void
 dhcp_readbpf(void *arg)
 {
        struct interface *ifp = arg;
-       uint8_t buf[MTU_MAX];
+       uint8_t buf[FRAMELEN_MAX];
        ssize_t bytes;
        struct dhcp_state *state = D_STATE(ifp);
        ssize_t fl = (ssize_t)bpf_frame_header_len(ifp);
index 2f147f1da8b2a80d53353e596e2acfbf15745a3a..e24a77a307147b804e21543a2c1fdd8e339d3ee7 100644 (file)
--- a/src/if.h
+++ b/src/if.h
@@ -90,6 +90,10 @@ typedef unsigned long                ioctl_request_t;
 #  define ARPHRD_INFINIBAND            32
 #endif
 
+/* Maximum frame length.
+ * Support jumbo frames and some extra. */
+#define        FRAMELEN_MAX                    10240
+
 /* Work out if we have a private address or not
  * 10/8
  * 172.16/12
index bb6ee083c41aae5d5b72c9f23722dcd5e566ff7a..e5e9ad2b9537740060f245a8355fa5d6b4915921 100644 (file)
@@ -59,7 +59,7 @@ ps_bpf_recvbpf(void *arg)
 {
        struct ps_process *psp = arg;
        unsigned int flags;
-       uint8_t buf[MTU_MAX];
+       uint8_t buf[FRAMELEN_MAX];
        ssize_t len;
        struct ps_msghdr psm = {
                .ps_id = psp->psp_id,