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>
This commit is contained in:
Guy Harris 2014-04-08 01:22:57 -07:00
parent abbdcd8750
commit d3df2e588b
6 changed files with 8 additions and 29 deletions

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "config.h"
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#include <glib.h>
#include <epan/packet.h>

View File

@ -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>

View File

@ -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>

View File

@ -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);

View File

@ -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>