diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-04-08 01:22:57 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-04-08 08:23:34 +0000 |
commit | d3df2e588bc6febb5b2d414ad040ede903ef4c85 (patch) | |
tree | 994425e2302da966d623a4a3b68b5c63d62b8758 | |
parent | abbdcd875048e9182ea8f3674c0a452e64095125 (diff) |
On UN*X, <arpa/inet.h> suffices for struct in_addr and in_addr_t.
So don't pull in <netinet/in.h>. Also, avoid <sys/types.h> in
packet-dcom.c.
While we're at it, do *not* assume that pinfo->src or pinfo->dst are
IPv4 addresses.
Change-Id: I5fc8e859780a8d863aaf6e90a21a7039cabae0e6
Reviewed-on: https://code.wireshark.org/review/1006
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/dissectors/packet-dcom.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-fcdns.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-lbm.h | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-lbmc.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-lbmr.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-lbtrm.c | 6 |
6 files changed, 8 insertions, 29 deletions
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index beb75730de..d26b407f96 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -65,15 +65,8 @@ #include "config.h" -/* - * XXX - are the next two includes necessary? - */ -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif - -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> #endif #ifdef HAVE_WINSOCK2_H diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index e3cf464ded..3e7aea9861 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -25,10 +25,6 @@ #include "config.h" -#ifdef HAVE_NETINET_IN_H -# include <netinet/in.h> -#endif - #include <glib.h> #include <epan/packet.h> diff --git a/epan/dissectors/packet-lbm.h b/epan/dissectors/packet-lbm.h index 1757129edc..b9c3e10078 100644 --- a/epan/dissectors/packet-lbm.h +++ b/epan/dissectors/packet-lbm.h @@ -28,9 +28,6 @@ #include "config.h" #include <errno.h> #include <glib.h> -#if HAVE_NETINET_IN_H - #include <netinet/in.h> -#endif #include <wsutil/inet_aton.h> #include <epan/address.h> #include <epan/packet.h> diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index 8afb3638c7..36b5318d5e 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -23,11 +23,6 @@ */ #include "config.h" -#if HAVE_NETINET_IN_H - #include <netinet/in.h> -#else -typedef unsigned int in_addr_t; -#endif #include <glib.h> #include <epan/packet.h> #include <epan/prefs.h> diff --git a/epan/dissectors/packet-lbmr.c b/epan/dissectors/packet-lbmr.c index a067dc9661..29f1bdc821 100644 --- a/epan/dissectors/packet-lbmr.c +++ b/epan/dissectors/packet-lbmr.c @@ -23,10 +23,8 @@ */ #include "config.h" -#if HAVE_NETINET_IN_H - #include <netinet/in.h> -#else -typedef unsigned int in_addr_t; +#ifdef HAVE_ARPA_INET_H + #include <arpa/inet.h> #endif #if HAVE_WINSOCK2_H #include <winsock2.h> @@ -2048,6 +2046,8 @@ static gboolean lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * in_addr_t dest_addr_h; in_addr_t src_addr_h; + if (pinfo->dst.type != AT_IPv4 || pinfo->src.type != AT_IPv4) + return (FALSE); dest_addr = *((in_addr_t *)pinfo->dst.data); dest_addr_h = g_ntohl(dest_addr); src_addr = *((in_addr_t *)pinfo->src.data); diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c index f712716f4b..7ff060ad5a 100644 --- a/epan/dissectors/packet-lbtrm.c +++ b/epan/dissectors/packet-lbtrm.c @@ -23,10 +23,8 @@ */ #include "config.h" -#if HAVE_NETINET_IN_H - #include <netinet/in.h> -#else -typedef unsigned int in_addr_t; +#ifdef HAVE_ARPA_INET_H + #include <arpa/inet.h> #endif #if HAVE_WINSOCK2_H #include <winsock2.h> |