diff --git a/gencode.c b/gencode.c index 3fc9777..e3425cd 100644 --- a/gencode.c +++ b/gencode.c @@ -6955,15 +6955,11 @@ gen_mcode(compiler_state_t *cstate, const char *s1, const char *s2, return (NULL); nlen = __pcap_atoin(s1, &n); - if (nlen < 0) - bpf_error(cstate, "invalid IPv4 address '%s'", s1); /* Promote short ipaddr */ n <<= 32 - nlen; if (s2 != NULL) { mlen = __pcap_atoin(s2, &m); - if (mlen < 0) - bpf_error(cstate, "invalid IPv4 address '%s'", s2); /* Promote short ipaddr */ m <<= 32 - mlen; if ((n & ~m) != 0) @@ -7021,11 +7017,8 @@ gen_ncode(compiler_state_t *cstate, const char *s, bpf_u_int32 v, struct qual q) vlen = __pcap_atodn(s, &v); if (vlen == 0) bpf_error(cstate, "malformed decnet address '%s'", s); - } else { + } else vlen = __pcap_atoin(s, &v); - if (vlen < 0) - bpf_error(cstate, "invalid IPv4 address '%s'", s); - } switch (q.addr) { diff --git a/nametoaddr.c b/nametoaddr.c index 34a8b55..7c48bd3 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -653,15 +653,8 @@ __pcap_atoin(const char *s, bpf_u_int32 *addr) len = 0; for (;;) { n = 0; - while (*s && *s != '.') { - if (n > 25) { - /* The result will be > 255 */ - return -1; - } + while (*s && *s != '.') n = n * 10 + *s++ - '0'; - } - if (n > 255) - return -1; *addr <<= 8; *addr |= n & 0xff; len += 8; diff --git a/pcap-config.in b/pcap-config.in index 6f656d4..54ca42f 100644 --- a/pcap-config.in +++ b/pcap-config.in @@ -11,6 +11,7 @@ prefix="@prefix@" exec_prefix="@exec_prefix@" includedir="@includedir@" +libdir="@libdir@" V_RPATH_OPT="@V_RPATH_OPT@" LIBS="@LIBS@" PACKAGE_NAME="@PACKAGE_NAME@" @@ -40,6 +41,16 @@ do esac shift done +if [ "$V_RPATH_OPT" != "" ] +then + # + # If libdir isn't /usr/lib, add it to the run-time linker path. + # + if [ "$libdir" != "/usr/lib" ] + then + RPATH=$V_RPATH_OPT$libdir + fi +fi if [ "$static" = 1 ] then # @@ -48,16 +59,16 @@ then # if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] then - echo "-lpcap @LIBS@" + echo "-I$includedir -L$libdir -lpcap $LIBS" elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] then - echo "@LIBS@" + echo "-I$includedir -L$libdir $LIBS" elif [ "$show_cflags" = 1 ] then - echo "" + echo "-I$includedir" elif [ "$show_libs" = 1 ] then - echo "-lpcap @LIBS@" + echo "-L$libdir -lpcap $LIBS" elif [ "$show_additional_libs" = 1 ] then echo "$LIBS" @@ -69,15 +80,15 @@ else # if [ "$show_cflags" = 1 -a "$show_libs" = 1 ] then - echo "-lpcap" + echo "-I$includedir -L$libdir $RPATH -l$PACKAGE_NAME" elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ] then - echo "" + echo "-I$includedir" elif [ "$show_cflags" = 1 ] then - echo "" + echo "-I$includedir" elif [ "$show_libs" = 1 ] then - echo "-lpcap" + echo "-L$libdir $RPATH -l$PACKAGE_NAME" fi fi diff --git a/pcap-linux.c b/pcap-linux.c index afcaea7..70334b3 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -3835,10 +3835,6 @@ activate_new(pcap_t *handle) handle->linktype = DLT_LINUX_SLL; } - /* Hack to make things work on s390 ctc interfaces */ - if (strncmp("ctc", device, 3) == 0) - handle->linktype = DLT_EN10MB; - handlep->ifindex = iface_get_id(sock_fd, device, handle->errbuf); if (handlep->ifindex == -1) { diff --git a/pcap.3pcap.in b/pcap.3pcap.in index c5bf3fc..8010140 100644 --- a/pcap.3pcap.in +++ b/pcap.3pcap.in @@ -958,7 +958,7 @@ use an script or some other configuration script to check whether the libpcap 1.0 APIs are available and use them only if they are. .SH SEE ALSO -autoconf(1), tcpdump(8), tcpslice(8), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), +autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), usermod(@MAN_ADMIN_COMMANDS@) .SH AUTHORS The original authors of libpcap are: