mirror of
https://github.com/PDP-10/klh10.git
synced 2026-01-11 23:52:54 +00:00
Attempt a replacement for pcap_set_immediate_mode() if missing.
This commit is contained in:
parent
334719e73a
commit
0ac7cd4cdb
@ -27,7 +27,7 @@ NETLIBS = @NETLIBS@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
KLH10_HOME = ${DESTDIR}@bindir@
|
||||
KLH10_HOME ?= ${DESTDIR}@bindir@
|
||||
|
||||
# Source definitions
|
||||
CENVFLAGS = @CENVFLAGS@
|
||||
|
||||
@ -109,6 +109,7 @@ showdefs:
|
||||
@echo "CONFFLAGS = $(CONFFLAGS)"
|
||||
@echo "CONFFLAGS_AUX = $(CONFFLAGS_AUX)"
|
||||
@echo "BUILDMOD = $(BUILDMOD)"
|
||||
@echo "KLH10_HOME = $(KLH10_HOME)"
|
||||
|
||||
|
||||
# Generally applicable rules
|
||||
|
||||
13
src/osdnet.c
13
src/osdnet.c
@ -1383,7 +1383,7 @@ osn_pfinit_pcap(struct pfdata *pfdata, struct osnpf *osnpf, void *pfarg)
|
||||
what = "pcap_set_immediate_mode";
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_PCAP_SET_IMMEDIATE_MODE */
|
||||
|
||||
/* Set read timeout.
|
||||
Safety check in order to avoid infinite hangs if something
|
||||
@ -1429,6 +1429,17 @@ osn_pfinit_pcap(struct pfdata *pfdata, struct osnpf *osnpf, void *pfarg)
|
||||
|
||||
pfdata->pf_fd = pcap_get_selectable_fd(pc);
|
||||
|
||||
#if !HAVE_PCAP_SET_IMMEDIATE_MODE && defined(BIOCIMMEDIATE)
|
||||
/* Try to set immediate mode another way. Assume BPF since we know how to
|
||||
* do that. But don't complain if it fails, since it libpcap may use
|
||||
* something else.
|
||||
*/
|
||||
{
|
||||
int yes = 1;
|
||||
ioctl(pcap_fileno(pc), BIOCIMMEDIATE, &yes);
|
||||
}
|
||||
#endif /* !HAVE_PCAP_SET_IMMEDIATE_MODE */
|
||||
|
||||
/* Now get our interface's ethernet address. */
|
||||
(void) osn_ifealookup(ifnam, (unsigned char *) &osnpf->osnpf_ea);
|
||||
if (DP_DBGFLG) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user