From 5696536bcf727a7e5598e1185ed84b408b3611bc Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Fri, 26 Apr 2019 09:22:26 +0900 Subject: [PATCH] Add more padding for arp packets The minimum size of ethernet frame is 512 bits (64 octets). It is required for correct CSMA/CD protocol operation. (ref: 4.2.3.3 and 4.4.2, IEEE Std 802.3-2018) dev_validate_header() in linux/net/packet/af_packet.c checks the frame size and sendto() returns EINVAL if it returns false. Change-Id: If42738cb796e4827ae396bc1b4f596c2c498bf65 Signed-off-by: Cheoleun Moon --- src/ip-conflict-detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip-conflict-detect.c b/src/ip-conflict-detect.c index 4c2a3f3..9021c04 100755 --- a/src/ip-conflict-detect.c +++ b/src/ip-conflict-detect.c @@ -75,7 +75,7 @@ struct arp_message { unsigned char s_IPaddr[IP_ADDRESS_LENGTH]; /* sender IP address */ unsigned char t_hwaddr[MAC_ADDRESS_LENGTH]; /* target hardware address */ unsigned char t_IPaddr[IP_ADDRESS_LENGTH]; /* target IP address */ - unsigned char pad[18]; /* pad for min. Ethernet payload (60 bytes) */ + unsigned char pad[22]; /* pad for min. Ethernet payload (64 bytes) */ }; typedef enum { -- 2.7.4