diff options
author | Jose Alonso Cardenas Marquez <acm@FreeBSD.org> | 2021-01-06 08:42:12 +0000 |
---|---|---|
committer | Jose Alonso Cardenas Marquez <acm@FreeBSD.org> | 2021-01-06 08:42:12 +0000 |
commit | a22e5bb83ae87cf48c24a2653363727e9bd07b12 (patch) | |
tree | 70891a98454c72433c72480e2cd2521fc1685cad /security/gvm-libs/files/patch-boreas_util.c | |
parent | - Connect security/py-python-gvm (diff) |
- New port: security/gvm-libs
This is the libraries module for the Greenbone Vulnerability Management
Solution.
It is used for the Greenbone Security Manager appliances and provides various
functionalities to support the integrated service daemons.
WWW: https://github.com/greenbone/gvm-libs
Notes
Notes:
svn path=/head/; revision=560472
Diffstat (limited to 'security/gvm-libs/files/patch-boreas_util.c')
-rw-r--r-- | security/gvm-libs/files/patch-boreas_util.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/security/gvm-libs/files/patch-boreas_util.c b/security/gvm-libs/files/patch-boreas_util.c new file mode 100644 index 000000000000..1de3346db51b --- /dev/null +++ b/security/gvm-libs/files/patch-boreas_util.c @@ -0,0 +1,62 @@ +--- boreas/util.c 2020-12-30 23:52:07.849996000 -0500 ++++ boreas/util.c 2020-12-31 01:36:37.600382000 -0500 +@@ -21,12 +21,20 @@ + + #include "../base/networking.h" /* for range_t */ + ++#include <stdio.h> ++#include <sys/types.h> ++#include <sys/socket.h> + #include <errno.h> + #include <glib.h> + #include <ifaddrs.h> /* for getifaddrs() */ + #include <net/ethernet.h> + #include <net/if.h> /* for if_nametoindex() */ +-#include <netpacket/packet.h> /* for sockaddr_ll */ ++#ifdef AF_LINK ++# include <net/if_dl.h> ++#endif ++#ifdef AF_PACKET ++# include <netpacket/packet.h> ++#endif + #include <stdlib.h> + #include <string.h> + #include <sys/socket.h> +@@ -109,22 +117,22 @@ + { + for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) + { +- if ((ifa->ifa_addr) && (ifa->ifa_addr->sa_family == AF_PACKET) ++ if ((ifa->ifa_addr) && (ifa->ifa_addr->sa_family == AF_LINK) + && !(ifa->ifa_flags & (IFF_LOOPBACK))) + { + if (interface_provided) + { + if (g_strcmp0 (interface, ifa->ifa_name) == 0) + { +- struct sockaddr_ll *s = +- (struct sockaddr_ll *) ifa->ifa_addr; +- memcpy (mac, s->sll_addr, 6 * sizeof (uint8_t)); ++ struct sockaddr_dl *s = ++ (struct sockaddr_dl *) ifa->ifa_addr; ++ memcpy (mac, s->sdl_data, 6 * sizeof (uint8_t)); + } + } + else + { +- struct sockaddr_ll *s = (struct sockaddr_ll *) ifa->ifa_addr; +- memcpy (mac, s->sll_addr, 6 * sizeof (uint8_t)); ++ struct sockaddr_dl *s = (struct sockaddr_dl *) ifa->ifa_addr; ++ memcpy (mac, s->sdl_data, 6 * sizeof (uint8_t)); + } + } + } +@@ -508,7 +516,7 @@ + break; + case ARPV4: + { +- soc = socket (PF_PACKET, SOCK_RAW, htons (ETH_P_ALL)); ++ soc = socket (PF_LINK, SOCK_RAW, 0); + if (soc < 0) + { + g_warning ("%s: failed to open ARPV4 socket: %s", __func__, |