diff options
author | Ali Abdulkadir <autostart.ini@gmail.com> | 2018-11-23 00:14:42 +0300 |
---|---|---|
committer | Ali Abdulkadir <autostart.ini@gmail.com> | 2018-11-23 00:19:12 +0300 |
commit | 5e93c69e3b6966bf2ff7af3d32122d23fea01450 (patch) | |
tree | 261a6f7a4fc4bee69951f2152eefae7bb48058e6 | |
parent | 9ea4ecca0de24831675fe34b351977e5fb61b66e (diff) | |
parent | a936e301df73140703128dcf616dab8f28e5abe7 (diff) | |
download | libnet-5e93c69e3b6966bf2ff7af3d32122d23fea01450.tar.gz |
Fixed merge conflict
-rw-r--r-- | libnet/configure.ac | 4 | ||||
-rw-r--r-- | libnet/m4/acinclude.m4 | 1 | ||||
-rw-r--r-- | libnet/src/libnet_link_linux.c | 1 | ||||
-rw-r--r-- | libnet/src/libnet_prand.c | 10 | ||||
-rw-r--r-- | libnet/win32/config.h | 1 |
5 files changed, 11 insertions, 6 deletions
diff --git a/libnet/configure.ac b/libnet/configure.ac index 27000d1..9713368 100644 --- a/libnet/configure.ac +++ b/libnet/configure.ac @@ -245,10 +245,12 @@ case "$target_os" in [Define as necessary to "unhide" header symbols.]) AC_DEFINE(__BSD_SOURCE, 1, [Define as necessary to "unhide" header symbols.]) + AC_DEFINE(_DEFAULT_SOURCE, 1, + [Define as necessary to "unhide" header symbols.]) AC_DEFINE(__FAVOR_BSD, 1, [Define if we should favor the BSD APIs when possible in Linux.]) - LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD" + LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D_DEFAULT_SOURCE -D__FAVOR_BSD" AC_CHECK_HEADERS(net/ethernet.h, \ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H") ;; diff --git a/libnet/m4/acinclude.m4 b/libnet/m4/acinclude.m4 index 5b89bc8..9ed3677 100644 --- a/libnet/m4/acinclude.m4 +++ b/libnet/m4/acinclude.m4 @@ -167,6 +167,7 @@ AC_DEFUN([AC_LIBNET_CHECK_IP_CSUM], AC_TRY_COMPILE([ #define __BSD_SOURCE #define _BSD_SOURCE + #define _DEFAULT_SOURCE #include <sys/types.h> #include <netinet/in.h> #include <netinet/in_systm.h> diff --git a/libnet/src/libnet_link_linux.c b/libnet/src/libnet_link_linux.c index 3c6df3c..6fa8665 100644 --- a/libnet/src/libnet_link_linux.c +++ b/libnet/src/libnet_link_linux.c @@ -114,6 +114,7 @@ libnet_open_link(libnet_t *l) case ARPHRD_SLIP6: case ARPHRD_CSLIP6: case ARPHRD_PPP: + case ARPHRD_NONE: l->link_type = DLT_RAW; break; case ARPHRD_FDDI: diff --git a/libnet/src/libnet_prand.c b/libnet/src/libnet_prand.c index db9bf89..915a4d6 100644 --- a/libnet/src/libnet_prand.c +++ b/libnet/src/libnet_prand.c @@ -92,15 +92,15 @@ libnet_get_prand(int mod) switch (mod) { case LIBNET_PR2: - return (n % 0x2); /* 0 - 1 */ + return (n & 0x1); /* 0 - 1 */ case LIBNET_PR8: - return (n % 0xff); /* 0 - 255 */ + return (n & 0xff); /* 0 - 255 */ case LIBNET_PR16: - return (n % 0x7fff); /* 0 - 32767 */ + return (n & 0x7fff); /* 0 - 32767 */ case LIBNET_PRu16: - return (n % 0xffff); /* 0 - 65535 */ + return (n & 0xffff); /* 0 - 65535 */ case LIBNET_PR32: - return (n % 0x7fffffff); /* 0 - 2147483647 */ + return (n & 0x7fffffff); /* 0 - 2147483647 */ case LIBNET_PRu32: return (n); /* 0 - 4294967295 */ } diff --git a/libnet/win32/config.h b/libnet/win32/config.h index 926f12f..54f0c6a 100644 --- a/libnet/win32/config.h +++ b/libnet/win32/config.h @@ -17,6 +17,7 @@ #undef STUPID_SOLARIS_CHECKSUM_BUG #undef _BSD_SOURCE #undef __BSD_SOURCE +#undef _DEFAULT_SOURCE #undef __FAVOR_BSD #undef LIBNET_BIG_ENDIAN #define LIBNET_LIL_ENDIAN 1 |