diff --git a/Makefile b/Makefile index 01cc9ad..d1f2e95 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ethsock.c b/ethsock.c index 61e9759..24d2b82 100644 --- a/ethsock.c +++ b/ethsock.c @@ -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; } diff --git a/nmrp.c b/nmrp.c index 81b6a80..ce0411f 100644 --- a/nmrp.c +++ b/nmrp.c @@ -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; }