bootp: Always have SIP Server IP be an IP address
authorMichael Mann <mmann78@netscape.net>
Tue, 16 May 2017 23:29:01 +0000 (19:29 -0400)
committerMichael Mann <mmann78@netscape.net>
Wed, 17 May 2017 12:35:06 +0000 (12:35 +0000)
Change-Id: Idf6b31748ee5aa04e8660a0eb283072da855dda2
Reviewed-on: https://code.wireshark.org/review/21692
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-bootp.c

index 8cc49e13331239babf385e865f97195e2f914aec..1b9e48859fada3b2214c66929e43075c87cdba64 100644 (file)
@@ -491,7 +491,6 @@ static int hf_bootp_option_sip_server_refer_last_option = -1;                       /* 120 */
 static int hf_bootp_option_sip_server_enc = -1;                                /* 120 */
 static int hf_bootp_option_sip_server_name = -1;                               /* 120 */
 static int hf_bootp_option_sip_server_address = -1;                            /* 120 */
-static int hf_bootp_option_sip_server_address_stringz = -1;            /* 120 */
 static int hf_bootp_option_classless_static_route = -1;                        /* 120 */
 static int hf_bootp_option_rfc3825_error = -1;                                 /* 123 */
 static int hf_bootp_option_rfc3825_latitude = -1;                              /* 123 */
@@ -2706,18 +2705,9 @@ dissect_bootpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
                                        /* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
                                        proto_tree_add_item(tree, hf_bootp_option_sip_server_address, rfc3396_sip_server.tvb_composite, composite_offset, 4, ENC_BIG_ENDIAN);
                                } else {
+                                       guint32 sip_server = tvb_get_ntohl(rfc3396_sip_server.tvb_composite, composite_offset);
                                        /* RFC 3396 is used, so the option is split into several option 120. We don't link fqdn with v_tree. */
-                                       /* Since we don't use the "numbered argument" as described by README.developer, we have to repeat the arguments :( */
-                                       proto_tree_add_string(tree, hf_bootp_option_sip_server_address_stringz, tvb, 0, 0,
-                                                                                       wmem_strdup_printf(wmem_packet_scope(), "%u.%u.%u.%u (%u.%u.%u.%u)",
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 1),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 2),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 3),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 1),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 2),
-                                                                                               tvb_get_guint8(rfc3396_sip_server.tvb_composite, composite_offset + 3)));
+                                       proto_tree_add_uint(tree, hf_bootp_option_sip_server_address, tvb, 0, 0, sip_server);
                                }
                                composite_offset += 4;
                        }
@@ -8407,11 +8397,6 @@ proto_register_bootp(void)
                    FT_IPv4, BASE_NONE, NULL, 0x0,
                    "Option 120: SIP Server Address", HFILL }},
 
-               { &hf_bootp_option_sip_server_address_stringz,
-                 { "SIP Server Address", "bootp.option.sip_server.address.stringz",
-                   FT_STRINGZ, BASE_NONE, NULL, 0x0,
-                   "Option 120: SIP Server Address", HFILL }},
-
                { &hf_bootp_option_classless_static_route,
                  { "Subnet/MaskWidth-Router", "bootp.option.classless_static_route.",
                    FT_BYTES, BASE_NONE, NULL, 0x0,