diff options
author | wxs <wxs@FreeBSD.org> | 2010-03-02 03:14:02 +0800 |
---|---|---|
committer | wxs <wxs@FreeBSD.org> | 2010-03-02 03:14:02 +0800 |
commit | aeedaeca2ab607d7e48721885fd8614ccbbbff62 (patch) | |
tree | bc08f26fc4004e93ee1f619a31632829b89972e7 /net | |
parent | 119f8795179e4839355f145ef8c9df8d214149ea (diff) | |
download | freebsd-ports-gnome-aeedaeca2ab607d7e48721885fd8614ccbbbff62.tar.gz freebsd-ports-gnome-aeedaeca2ab607d7e48721885fd8614ccbbbff62.tar.zst freebsd-ports-gnome-aeedaeca2ab607d7e48721885fd8614ccbbbff62.zip |
- Fix build on -CURRENT.
Obtained from: r203052
Feature safe: yes
Diffstat (limited to 'net')
-rw-r--r-- | net/libpcap/files/patch-inet.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/net/libpcap/files/patch-inet.c b/net/libpcap/files/patch-inet.c new file mode 100644 index 000000000000..eb0bba74e460 --- /dev/null +++ b/net/libpcap/files/patch-inet.c @@ -0,0 +1,39 @@ +--- ./inet.c.orig 2008-08-31 22:44:54.000000000 -0400 ++++ ./inet.c 2010-03-01 13:59:26.873317983 -0500 +@@ -401,10 +401,15 @@ + pcap_if_t *curdev; + char *description = NULL; + pcap_addr_t *curaddr, *prevaddr, *nextaddr; ++ int s; + #ifdef SIOCGIFDESCR + struct ifreq ifrdesc; ++#ifndef IFDESCRSIZE ++#define _IFDESCRSIZE 64 ++ char ifdescr[_IFDESCRSIZE]; ++#else + char ifdescr[IFDESCRSIZE]; +- int s; ++#endif + #endif + + #ifdef SIOCGIFDESCR +@@ -413,12 +418,17 @@ + */ + memset(&ifrdesc, 0, sizeof ifrdesc); + strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name); ++#ifdef __FreeBSD__ ++ ifrdesc.ifr_buffer.buffer = ifdescr; ++ ifrdesc.ifr_buffer.length = sizeof(ifdescr); ++#else + ifrdesc.ifr_data = (caddr_t)&ifdescr; ++#endif + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s >= 0) { + if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0 && +- strlen(ifrdesc.ifr_data) != 0) +- description = ifrdesc.ifr_data; ++ strlen(ifdescr) != 0) ++ description = ifdescr; + close(s); + } + #endif |