]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ospf6.c
Add a nd_print_trunc() call
[tcpdump] / print-ospf6.c
index 0ca3dbd999dfce054ae0a46f625e2173eb72f1c8..756d25e21a92e55577c7d79d400d8d63564dd9cc 100644 (file)
@@ -284,7 +284,6 @@ struct lsu6 {
     struct lsa6 lsu_lsa[1]; /* may repeat      */
 };
 
-static const char tstr[] = " [|ospf3]";
 
 static const struct tok ospf6_option_values[] = {
        { OSPF6_OPTION_V6,      "V6" },
@@ -483,7 +482,7 @@ ospf6_print_lsa(netdissect_options *ndo,
         * header.
         */
         if (length < sizeof(struct lsa6_hdr) || (const u_char *)lsap + length > dataend)
-               return (1);
+               return (1);
         lsa_length = length - sizeof(struct lsa6_hdr);
         tptr = (const uint8_t *)lsap+sizeof(struct lsa6_hdr);
 
@@ -693,13 +692,13 @@ ospf6_print_lsa(netdissect_options *ndo,
                break;
 
         case LS_TYPE_GRACE | LS_SCOPE_LINKLOCAL:
-                if (ospf_print_grace_lsa(ndo, tptr, lsa_length) == -1) {
+                if (ospf_grace_lsa_print(ndo, tptr, lsa_length) == -1) {
                     return 1;
                 }
                 break;
 
         case LS_TYPE_INTRA_ATE | LS_SCOPE_LINKLOCAL:
-                if (ospf_print_te_lsa(ndo, tptr, lsa_length) == -1) {
+                if (ospf_te_lsa_print(ndo, tptr, lsa_length) == -1) {
                     return 1;
                 }
                 break;
@@ -962,6 +961,7 @@ ospf6_print(netdissect_options *ndo,
        const char *cp;
        uint16_t datalen;
 
+       ndo->ndo_protocol = "ospf3";
        op = (const struct ospf6hdr *)bp;
 
        /* If the type is valid translate it, or just print the type */
@@ -1011,5 +1011,5 @@ ospf6_print(netdissect_options *ndo,
 
        return;
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }