diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-cipsafety.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-icmp.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 12 | ||||
-rw-r--r-- | epan/ipv4.h | 2 |
4 files changed, 5 insertions, 14 deletions
diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c index eb40a6b7a1..233e6b5161 100644 --- a/epan/dissectors/packet-cipsafety.c +++ b/epan/dissectors/packet-cipsafety.c @@ -1484,7 +1484,7 @@ static void dissect_cip_safety_data( proto_tree *tree, proto_item *item, tvbuff_t *tvb, int item_length, packet_info *pinfo, cip_safety_info_t* safety_info) { int base_length, io_data_size; - gboolean multicast = (((pntoh32(pinfo->dst.data)) & 0xf0000000) == 0xe0000000); + gboolean multicast = in4_addr_is_multicast(pntoh32(pinfo->dst.data)); gboolean server_dir = FALSE; enum enip_connid_type conn_type = ECIDT_UNKNOWN; enum cip_safety_format_type format = CIP_SAFETY_BASE_FORMAT; diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index e9b9767c1f..0dd9d565a9 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -357,8 +357,7 @@ static const value_string interface_role_str[] = { #define MPLS_EXTENDED_PAYLOAD_C_TYPE 1 /* Return true if the address is in the 224.0.0.0/4 network block */ -#define is_a_multicast_addr(a) \ - ((g_ntohl(a) & 0xf0000000) == 0xe0000000) +#define is_a_multicast_addr(a) in4_addr_is_multicast(g_ntohl(a)) /* Return true if the address is the 255.255.255.255 broadcast address */ #define is_a_broadcast_addr(a) \ diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 998ab0a372..28be99e498 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -498,14 +498,6 @@ const value_string ip_version_vals[] = { #define IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL 0x1000 /* larger than max ttl */ #define IPLOCAL_NETWRK_CTRL_BLK_DEFAULT_TTL 0X01 -/* Return true if the address is in the 224.0.0.0/24 network block */ -#define is_a_local_network_control_block_addr(addr) \ - ((addr & 0xffffff00) == 0xe0000000) - -/* Return true if the address is in the 224.0.0.0/4 network block */ -#define is_a_multicast_addr(addr) \ - ((addr & 0xf0000000) == 0xe0000000) - static void ip_prompt(packet_info *pinfo, gchar* result) { g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", @@ -2174,14 +2166,14 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* * (e.g. 224.0.0.0/4) ... and the payload isn't protocol 103 (PIM). * (see http://tools.ietf.org/html/rfc3973#section-4.7). */ - if (is_a_local_network_control_block_addr(dst32)) { + if (in4_addr_is_local_network_control_block(dst32)) { ttl = local_network_control_block_addr_valid_ttl(dst32); if (ttl != iph->ip_ttl && ttl != IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL) { expert_add_info_format(pinfo, ttl_item, &ei_ip_ttl_lncb, "\"Time To Live\" != %d for a packet sent to the " "Local Network Control Block (see RFC 3171)", ttl); } - } else if (!is_a_multicast_addr(dst32) && + } else if (!in4_addr_is_multicast(dst32) && /* At least BGP should appear here as well */ iph->ip_ttl < 5 && iph->ip_proto != IP_PROTO_PIM && diff --git a/epan/ipv4.h b/epan/ipv4.h index 979f5f52d6..af43414509 100644 --- a/epan/ipv4.h +++ b/epan/ipv4.h @@ -28,7 +28,7 @@ #ifndef __IPV4_H__ #define __IPV4_H__ -#include <glib.h> +#include <wsutil/inet_ipv4.h> typedef struct { guint32 addr; /* stored in host order */ |