mDNS and LLMNR also deviate from the TTL=1 for 224.0.0.0/24
- Fix two warnings about removing const by casting.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29644
f5534014-38df-0310-8fa8-
9805f1628bb7
#define IPLOCAL_NETWRK_CTRL_BLK_VRRP_TTL 0xFF
#define IPLOCAL_NETWRK_CTRL_BLK_GLPB_ADDR 0xE0000066
#define IPLOCAL_NETWRK_CTRL_BLK_GLPB_TTL 0XFF
#define IPLOCAL_NETWRK_CTRL_BLK_VRRP_TTL 0xFF
#define IPLOCAL_NETWRK_CTRL_BLK_GLPB_ADDR 0xE0000066
#define IPLOCAL_NETWRK_CTRL_BLK_GLPB_TTL 0XFF
+#define IPLOCAL_NETWRK_CTRL_BLK_MDNS_ADDR 0xE00000FB
+#define IPLOCAL_NETWRK_CTRL_BLK_MDNS_TTL 0XFF
+#define IPLOCAL_NETWRK_CTRL_BLK_LLMNR_ADDR 0xE00000FC
+
+#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 IPLOCAL_NETWRK_CTRL_BLK_DEFAULT_TTL 0X01
/* Return true if the address is in the 224.0.0.0/24 network block */
addr = tvb_get_ipv4(tvb, offset + optoffset);
proto_tree_add_text(field_tree, tvb, offset + optoffset, 4,
"%s%s",
addr = tvb_get_ipv4(tvb, offset + optoffset);
proto_tree_add_text(field_tree, tvb, offset + optoffset, 4,
"%s%s",
- ((addr == 0) ? "-" : (char *)get_hostname(addr)),
+ ((addr == 0) ? "-" : (const char *)get_hostname(addr)),
((optoffset == ptr) ? " <- (current)" : ""));
optoffset += 4;
optlen -= 4;
((optoffset == ptr) ? " <- (current)" : ""));
optoffset += 4;
optlen -= 4;
optlen -= 8;
proto_tree_add_text(field_tree, tvb, offset + optoffset, 8,
"Address = %s, time stamp = %u",
optlen -= 8;
proto_tree_add_text(field_tree, tvb, offset + optoffset, 8,
"Address = %s, time stamp = %u",
- ((addr == 0) ? "-" : (char *)get_hostname(addr)),
+ ((addr == 0) ? "-" : (const char *)get_hostname(addr)),
ts);
optoffset += 8;
} else {
ts);
optoffset += 8;
} else {
}
/* Returns the valid ttl for the group address */
}
/* Returns the valid ttl for the group address */
local_network_control_block_addr_valid_ttl(guint32 addr)
{
local_network_control_block_addr_valid_ttl(guint32 addr)
{
- /* An exception list, as Some protocols seem to insist on
- * doing differently:
- * - IETF's VRRP (rfc3768) always uses 224.0.0.18 with 255
- * - Cisco's GLPB always uses 224.0.0.102 with 255
- * Even more, VRRP and GLBP should probably be flagged as an error, if
- * seen with any TTL except 255.
+ /* An exception list, as some protocols seem to insist on
+ * doing differently:
+ /* IETF's VRRP (rfc3768) */
if (IPLOCAL_NETWRK_CTRL_BLK_VRRP_ADDR == addr)
return IPLOCAL_NETWRK_CTRL_BLK_VRRP_TTL;
if (IPLOCAL_NETWRK_CTRL_BLK_VRRP_ADDR == addr)
return IPLOCAL_NETWRK_CTRL_BLK_VRRP_TTL;
if (IPLOCAL_NETWRK_CTRL_BLK_GLPB_ADDR == addr)
return IPLOCAL_NETWRK_CTRL_BLK_GLPB_TTL;
if (IPLOCAL_NETWRK_CTRL_BLK_GLPB_ADDR == addr)
return IPLOCAL_NETWRK_CTRL_BLK_GLPB_TTL;
+ /* mDNS (draft-cheshire-dnsext-multicastdns-07) */
+ if (IPLOCAL_NETWRK_CTRL_BLK_MDNS_ADDR == addr)
+ return IPLOCAL_NETWRK_CTRL_BLK_MDNS_TTL;
+ /* LLMNR (rfc4795) */
+ if (IPLOCAL_NETWRK_CTRL_BLK_LLMNR_ADDR == addr)
+ return IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL;
return IPLOCAL_NETWRK_CTRL_BLK_DEFAULT_TTL;
}
return IPLOCAL_NETWRK_CTRL_BLK_DEFAULT_TTL;
}
proto_tree *tree;
proto_item *item, *ttl_item;
proto_tree *checksum_tree;
proto_tree *tree;
proto_item *item, *ttl_item;
proto_tree *checksum_tree;
*/
if (is_a_local_network_control_block_addr(dst32)) {
ttl = local_network_control_block_addr_valid_ttl(dst32);
*/
if (is_a_local_network_control_block_addr(dst32)) {
ttl = local_network_control_block_addr_valid_ttl(dst32);
- if (ttl != iph->ip_ttl) {
+ if (ttl != iph->ip_ttl && ttl != IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL) {
expert_add_info_format(pinfo, ttl_item, PI_SEQUENCE, PI_NOTE,
"\"Time To Live\" != %d for a packet sent to the Local Network Control Block (see RFC 3171)", ttl);
}
expert_add_info_format(pinfo, ttl_item, PI_SEQUENCE, PI_NOTE,
"\"Time To Live\" != %d for a packet sent to the Local Network Control Block (see RFC 3171)", ttl);
}