Skip to content

Commit

Permalink
Revert netmap regression, fix compile warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed Oct 31, 2018
1 parent 4ed687f commit 50aa4e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
10/31/2018 Version 4.3.0 beta2
- Fix maxOS TOS checksum failure (#524)
- Fix maxOS TOS checksum failure (#524)
- TCP sequence edits seeding (#514)
- Fix issues identifed by Codacy (#493)
- CVE-2018-18408 use-after-free in post_args (#489)
Expand Down
6 changes: 3 additions & 3 deletions src/common/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ get_interface_list(void)
&& strcmp("any", pcap_if_ptr->name)) {
#endif
#ifdef HAVE_NETMAP
int fd;
int fd = -1;

if (netmap_version == -1 || (fd = open ("/dev/netmap", O_RDWR)) < 0)
if (netmap_version != -1 && (fd = open ("/dev/netmap", O_RDWR)) < 0)
continue;

bzero(&nmr, sizeof(nmr));
strncpy(nmr.nr_name, pcap_if_ptr->name, sizeof(nmr.nr_name));
nmr.nr_version = netmap_version;
if (ioctl(fd, NIOCGINFO, &nmr) == 0) {
if (fd > 0 && ioctl(fd, NIOCGINFO, &nmr) == 0) {
#endif /* HAVE_NETMAP */
#if defined HAVE_LIBPCAP_NETMAP || defined HAVE_NETMAP
list_ptr->next = (interface_list_t *)safe_malloc(sizeof(interface_list_t));
Expand Down

0 comments on commit 50aa4e1

Please sign in to comment.