diff options
author | delphij <delphij@FreeBSD.org> | 2012-05-14 05:12:56 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2012-05-14 05:12:56 +0000 |
commit | a3451bb93bbf335a8f6b5feb9b80b256b0e304fe (patch) | |
tree | 158e6045ed438c41ac8de6cb27ac3c73cdc6643a /contrib/libpcap/inet.c | |
parent | a17ebbd192e814c313397aefc289ab32a0ece772 (diff) | |
parent | e11c3f548e0bd184480800016b8567824dc35516 (diff) | |
download | FreeBSD-src-a3451bb93bbf335a8f6b5feb9b80b256b0e304fe.zip FreeBSD-src-a3451bb93bbf335a8f6b5feb9b80b256b0e304fe.tar.gz |
Merge from vendor branch: update libpcap to 1.2.1.
MFC after: 2 weeks
Diffstat (limited to 'contrib/libpcap/inet.c')
-rw-r--r-- | contrib/libpcap/inet.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/libpcap/inet.c b/contrib/libpcap/inet.c index 178eb81..6ae46ef 100644 --- a/contrib/libpcap/inet.c +++ b/contrib/libpcap/inet.c @@ -133,6 +133,7 @@ add_or_find_if(pcap_if_t **curdev_ret, pcap_if_t **alldevs, const char *name, pcap_t *p; pcap_if_t *curdev, *prevdev, *nextdev; int this_instance; + char open_errbuf[PCAP_ERRBUF_SIZE]; /* * Is there already an entry in the list for this interface? @@ -192,11 +193,11 @@ add_or_find_if(pcap_if_t **curdev_ret, pcap_if_t **alldevs, const char *name, } strcpy(en_name, "en"); strcat(en_name, name + 3); - p = pcap_open_live(en_name, 68, 0, 0, errbuf); + p = pcap_open_live(en_name, 68, 0, 0, open_errbuf); free(en_name); } else #endif /* __APPLE */ - p = pcap_open_live(name, 68, 0, 0, errbuf); + p = pcap_open_live(name, 68, 0, 0, open_errbuf); if (p == NULL) { /* * No. Don't bother including it. @@ -476,8 +477,7 @@ add_addr_to_iflist(pcap_if_t **alldevs, const char *name, u_int flags, free(description); description = NULL; } - } else - break; + } #endif /* __FreeBSD__ */ close(s); if (description != NULL && strlen(description) == 0) { @@ -878,8 +878,10 @@ pcap_lookupdev(errbuf) */ while(NAdapts--) { - strcpy((char*)tUstr, tAstr); - (char*)tUstr += strlen(tAstr) + 1;; + char* tmp = (char*)tUstr; + strcpy(tmp, tAstr); + tmp += strlen(tAstr) + 1; + tUstr = (WCHAR*)tmp; tAstr += strlen(tAstr) + 1; } |