mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
arp-util: check ifindex and mac address
This commit is contained in:
parent
f6720fe62e
commit
504bf2b54a
@ -8,6 +8,7 @@
|
|||||||
#include <netinet/if_ether.h>
|
#include <netinet/if_ether.h>
|
||||||
|
|
||||||
#include "arp-util.h"
|
#include "arp-util.h"
|
||||||
|
#include "ether-addr-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "unaligned.h"
|
#include "unaligned.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -115,8 +116,10 @@ static int arp_send_packet(
|
|||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
|
||||||
assert(fd >= 0);
|
assert(fd >= 0);
|
||||||
|
assert(ifindex > 0);
|
||||||
assert(pa != 0);
|
assert(pa != 0);
|
||||||
assert(ha);
|
assert(ha);
|
||||||
|
assert(!ether_addr_is_null(ha));
|
||||||
|
|
||||||
memcpy(&arp.arp_sha, ha, ETH_ALEN);
|
memcpy(&arp.arp_sha, ha, ETH_ALEN);
|
||||||
memcpy(&arp.arp_tpa, &pa, sizeof(pa));
|
memcpy(&arp.arp_tpa, &pa, sizeof(pa));
|
||||||
|
Loading…
Reference in New Issue
Block a user