This commit is contained in:
Joseph C. Lehner 2016-08-09 17:20:13 +02:00
commit a3338dc16c
3 changed files with 7 additions and 7 deletions

View file

@ -29,7 +29,7 @@ install: nmrpflash
install -m 755 nmrpflash $(PREFIX)/bin
release/osx:
CFLAGS="-arch i686 -arch x86_64 -mmacosx-version-min=10.6" make release
CFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.6" make release
zip nmrpflash-osx.zip nmrpflash
release/linux: release

View file

@ -303,13 +303,13 @@ struct ethsock *ethsock_create(const char *intf, uint16_t protocol)
#ifndef NMRPFLASH_WINDOWS
sock->fd = pcap_get_selectable_fd(sock->pcap);
if (sock->fd == -1) {
fprintf(stderr, "No selectable file descriptor available.\n");
pcap_perror(sock->pcap, "pcap_get_selectable_fd");
goto cleanup_pcap;
}
#else
sock->handle = pcap_getevent(sock->pcap);
if (!sock->handle) {
fprintf(stderr, "No event handle available.\n");
pcap_perror(sock->pcap, "pcap_getevent");
goto cleanup_pcap;
}

8
nmrp.c
View file

@ -462,6 +462,10 @@ int nmrp_do(struct nmrpd_args *args)
return 1;
}
gsock = sock;
garp = 0;
sigh_orig = signal(SIGINT, sigh);
status = is_valid_ip(sock, &ipconf.addr, &ipconf.mask);
if (status <= 0) {
if (!status) {
@ -471,10 +475,6 @@ int nmrp_do(struct nmrpd_args *args)
goto out;
}
gsock = sock;
garp = 0;
sigh_orig = signal(SIGINT, sigh);
if (ethsock_set_timeout(sock, args->rx_timeout)) {
goto out;
}