From Didier Gautheron:
[obnox/wireshark/wip.git] / epan / dissectors / packet-pim.c
index 6a6591b742d977aa25e1b12e8c65c4b0b8e27040..89346d97bdfb18e97de3fb8d412d591fc6fea639 100644 (file)
@@ -115,8 +115,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     }
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "PIMv1");
-    if (check_col(pinfo->cinfo, COL_INFO))
-       col_clear(pinfo->cinfo, COL_INFO);
+    col_clear(pinfo->cinfo, COL_INFO);
 
     if (tree) {
        ti = proto_tree_add_item(tree, proto_pim, tvb, offset, -1, FALSE);
@@ -209,7 +208,6 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
     offset += 3;       /* skip reserved stuff */
 
-    if (tree) {
        if (tvb_reported_length_remaining(tvb, offset) > 0) {
            tiopt = proto_tree_add_text(pim_tree, tvb, offset, -1,
                    "PIM parameters");
@@ -251,7 +249,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
            /*
             * The rest of the packet is a multicast data packet.
             */
-           next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+           next_tvb = tvb_new_subset_remaining(tvb, offset);
 
            /*
             * It's an IP packet - determine whether it's IPv4 or IPv6.
@@ -470,7 +468,6 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        default:
            break;
        }
-    }
 done:;
 
     return offset+tvb_length_remaining(tvb, offset);
@@ -610,8 +607,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
     proto_item *tiopt;
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "PIM");
-    if (check_col(pinfo->cinfo, COL_INFO))
-       col_clear(pinfo->cinfo, COL_INFO);
+    col_clear(pinfo->cinfo, COL_INFO);
 
     pim_typever = tvb_get_guint8(tvb, 0);
 
@@ -858,7 +854,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
            /*
             * The rest of the packet is a multicast data packet.
             */
-           next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+           next_tvb = tvb_new_subset_remaining(tvb, offset);
 
            /*
             * It's an IP packet - determine whether it's IPv4 or IPv6.