aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnet/arp.c
diff options
context:
space:
mode:
authorLibravatar Nicholas Molloy <nick.a.molloy@gmail.com>2019-01-02 21:15:41 +1300
committerLibravatar Nicholas Molloy <nick.a.molloy@gmail.com>2019-01-02 21:23:40 +1300
commit81f4159fa88c8d34b291fe8708595d50ac68464c (patch)
treef59bba5e16bf1fb1a66a3619437bf12555558046 /src/fnet/arp.c
parentAdd a profile for ghostwriter (#2319) (diff)
downloadfirejail-81f4159fa88c8d34b291fe8708595d50ac68464c.tar.gz
firejail-81f4159fa88c8d34b291fe8708595d50ac68464c.tar.zst
firejail-81f4159fa88c8d34b291fe8708595d50ac68464c.zip
Correctly set address length in arp frames
Kernel commit 99137b7 introduced an additional check of the address length. This exposed a bug in the arp code where the address length was being set incorrectly. Now the length is set from the ETH_ALEN constant declared in linux/if_ether.h This fixes #2314
Diffstat (limited to 'src/fnet/arp.c')
-rw-r--r--src/fnet/arp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fnet/arp.c b/src/fnet/arp.c
index 794f6c8c8..3c2a2361b 100644
--- a/src/fnet/arp.c
+++ b/src/fnet/arp.c
@@ -124,7 +124,7 @@ void arp_scan(const char *dev, uint32_t ifip, uint32_t ifmask) {
124 errExit("if_nametoindex"); 124 errExit("if_nametoindex");
125 addr.sll_family = AF_PACKET; 125 addr.sll_family = AF_PACKET;
126 memcpy (addr.sll_addr, mac, 6); 126 memcpy (addr.sll_addr, mac, 6);
127 addr.sll_halen = htons(6); 127 addr.sll_halen = ETH_ALEN;
128 128
129 // build the arp packet header 129 // build the arp packet header
130 ArpHdr hdr; 130 ArpHdr hdr;