]> The Tcpdump Group git mirrors - tcpdump/commitdiff
OSPFv3: Remove two unnecessary dereferences
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 18 Feb 2022 18:55:41 +0000 (19:55 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 18 Feb 2022 19:05:35 +0000 (20:05 +0100)
Remove also two unnecessary ND_TCHECK_SIZE().

Moreover:
Remove an unnecessary cast.

print-ospf6.c

index 1bdcd68169a04c822fed89f8ddb0c66f414081e5..49167954e20c77cb0c10a1f8c861ffeaff94293c 100644 (file)
@@ -381,7 +381,7 @@ ospf6_print_ls_type(netdissect_options *ndo,
                ls_type & LS_TYPE_MASK,
                tok2str(ospf6_ls_scope_values, "Unknown", ls_type & LS_SCOPE_MASK),
                ls_type &0x8000 ? ", transitive" : "", /* U-bit */
                ls_type & LS_TYPE_MASK,
                tok2str(ospf6_ls_scope_values, "Unknown", ls_type & LS_SCOPE_MASK),
                ls_type &0x8000 ? ", transitive" : "", /* U-bit */
-               GET_IPADDR_STRING((const u_char *)ls_stateid));
+               GET_IPADDR_STRING(ls_stateid));
 }
 
 static int
 }
 
 static int
@@ -552,8 +552,7 @@ ospf6_print_lsa(netdissect_options *ndo,
                        if (lsa_length < sizeof (*ap))
                                return (1);
                        lsa_length -= sizeof (*ap);
                        if (lsa_length < sizeof (*ap))
                                return (1);
                        lsa_length -= sizeof (*ap);
-                       ND_TCHECK_SIZE(ap);
-                       ND_PRINT("\n\t\t%s", GET_IPADDR_STRING(*ap));
+                       ND_PRINT("\n\t\t%s", GET_IPADDR_STRING(ap));
                        ++ap;
                }
                break;
                        ++ap;
                }
                break;
@@ -762,8 +761,7 @@ ospf6_decode_v3(netdissect_options *ndo,
                        ND_PRINT("\n\t  Neighbor List:");
                        ap = hellop->hello_neighbor;
                        while ((const u_char *)ap < dataend) {
                        ND_PRINT("\n\t  Neighbor List:");
                        ap = hellop->hello_neighbor;
                        while ((const u_char *)ap < dataend) {
-                               ND_TCHECK_SIZE(ap);
-                               ND_PRINT("\n\t    %s", GET_IPADDR_STRING(*ap));
+                               ND_PRINT("\n\t    %s", GET_IPADDR_STRING(ap));
                                ++ap;
                        }
                }
                                ++ap;
                        }
                }