File arp-scan-avoid-crash.patch of Package arp-scan
commit 195ff60b98696e822c4a877523b2097d40386cc1
Author: Roy Hills <royhills@hotmail.com>
Date: Wed Dec 4 18:30:14 2013 +0000
Die with an error if we can't open a raw packet socket.
diff --git a/link-packet-socket.c b/link-packet-socket.c
index d25463b..de1eefc 100644
--- a/link-packet-socket.c
+++ b/link-packet-socket.c
@@ -68,8 +68,8 @@ link_open(const char *device) {
handle = Malloc(sizeof(*handle));
memset(handle, '\0', sizeof(*handle));
if ((handle->fd = socket(PF_PACKET, SOCK_RAW, 0)) < 0) {
- free(handle);
- return NULL;
+ warn_msg("ERROR: Cannot open raw packet socket");
+ err_sys("socket");
}
strlcpy(handle->ifr.ifr_name, device, sizeof(handle->ifr.ifr_name));
if ((ioctl(handle->fd, SIOCGIFINDEX, &(handle->ifr))) != 0)