Skip to content

Commit

Permalink
- libusipp: _mode after pcap_set_immediate
Browse files Browse the repository at this point in the history
  • Loading branch information
stealth committed Oct 1, 2016
1 parent 692f836 commit a6e7d44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -39,7 +39,7 @@ you prefer. In such case, you have to edit the generated `Makefile` to point to
as well as setting/unsetting the defines you need in `config.h`.

Having more than one libpcap install is not uncommon, since various functions such
as `pcap_set_immediate()` or mmapped packet sockets just appeared recently.
as `pcap_set_immediate_mode()` or mmapped packet sockets just appeared recently.


3. Compiling the examples
Expand Down
4 changes: 2 additions & 2 deletions src/config.h.in
Expand Up @@ -45,8 +45,8 @@
/* Define to 1 if you have the `pcap_inject' function. */
#undef HAVE_PCAP_INJECT

/* Define if you have pcap_set_immediate. */
#undef HAVE_PCAP_SET_IMMEDIATE
/* Define if you have pcap_set_immediate_mode. */
#undef HAVE_PCAP_SET_IMMEDIATE_MODE

/* Define if radiotap exists. */
#undef HAVE_RADIOTAP
Expand Down
6 changes: 3 additions & 3 deletions src/configure.ac
Expand Up @@ -73,11 +73,11 @@ case "$r" in
*)
esac

r=`grep pcap_set_immediate /usr/include/pcap/pcap.h 2>/dev/null`
r+=`grep pcap_set_immediate /usr/local/include/pcap/pcap.h 2>/dev/null`
r=`grep pcap_set_immediate_mode /usr/include/pcap/pcap.h 2>/dev/null`
r+=`grep pcap_set_immediate_mode /usr/local/include/pcap/pcap.h 2>/dev/null`
case "$r" in
*pcap_set_immediate*)
AC_DEFINE([HAVE_PCAP_SET_IMMEDIATE], [1], [Define if you have pcap_set_immediate.])
AC_DEFINE([HAVE_PCAP_SET_IMMEDIATE_MODE], [1], [Define if you have pcap_set_immediate_mode.])
echo "Enabling pcap_set_immediate"
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion src/datalink.cc
Expand Up @@ -263,7 +263,7 @@ int pcap::init_device(const string &dev, int promisc, size_t snaplen)
e += ebuf;
return die(e, STDERR, -1);
}
#ifdef HAVE_PCAP_SET_IMMEDIATE
#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
if (pcap_set_immediate_mode(d_pd, 1) < 0)
return die("pcap::init_device: Unable to set immediate mode.", STDERR, -1);
#endif
Expand Down

0 comments on commit a6e7d44

Please sign in to comment.