From ac4bfbc0be40706984164875630fd67339dc3dfe Mon Sep 17 00:00:00 2001 From: Po-Chuan Hsieh Date: Fri, 3 Jun 2022 16:50:47 +0800 Subject: net/p5-Net-ARP: Update to 1.0.12 Changes: https://metacpan.org/dist/Net-ARP/changes --- net/p5-Net-ARP/files/patch-send_packet_bsd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'net/p5-Net-ARP/files/patch-send_packet_bsd.c') 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); -- cgit v1.2.3