diff options
author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2022-06-03 16:50:47 +0800 |
---|---|---|
committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2022-06-03 17:00:31 +0800 |
commit | ac4bfbc0be40706984164875630fd67339dc3dfe (patch) | |
tree | 471d2fdbef2dcc0fe3bf97624201255133a82a16 /net/p5-Net-ARP/files/patch-send_packet_bsd.c | |
parent | dns/p5-Net-DNS: Update to 1.34 (diff) |
net/p5-Net-ARP: Update to 1.0.12
Changes: https://metacpan.org/dist/Net-ARP/changes
Diffstat (limited to 'net/p5-Net-ARP/files/patch-send_packet_bsd.c')
-rw-r--r-- | net/p5-Net-ARP/files/patch-send_packet_bsd.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/p5-Net-ARP/files/patch-send_packet_bsd.c b/net/p5-Net-ARP/files/patch-send_packet_bsd.c index f724e1f37041..c33169e8c71f 100644 --- a/net/p5-Net-ARP/files/patch-send_packet_bsd.c +++ b/net/p5-Net-ARP/files/patch-send_packet_bsd.c @@ -1,17 +1,17 @@ ---- send_packet_bsd.c.orig 2009-05-23 11:11:58 UTC +--- send_packet_bsd.c.orig 2022-05-11 08:27:25 UTC +++ send_packet_bsd.c -@@ -56,7 +56,13 @@ int send_packet_bsd(const char *dev, u_c - flock(bpffd,LOCK_EX); +@@ -60,7 +60,13 @@ int send_packet_bsd(const char *dev, u_char *packet, u + flock(bpffd, LOCK_EX); - // Bind it to a device -- ioctl(bpffd,BIOCSETIF,dev); -+ if (ioctl(bpffd,BIOCSETIF,dev) == -1) -+ { -+ flock(bpffd,LOCK_UN); -+ close(bpffd); -+ perror("open bpf"); -+ return 0; -+ } + // Bind it to a device +- ioctl(bpffd, BIOCSETIF, dev); ++ if (ioctl(bpffd, BIOCSETIF, dev) == -1) ++ { ++ flock(bpffd, LOCK_UN); ++ close(bpffd); ++ perror("open bpf"); ++ return 0; ++ } - // Send the packet and unlock - write(bpffd,packet,packetsize); + // Send the packet and unlock + write(bpffd, packet, packetsize); |