]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rsvp.c
CI: Add warning exemptions for Sun C (suncc-5.15) on Solaris 10
[tcpdump] / print-rsvp.c
index ed9373765509afdb99ea183624e625fe5ffd21d4..153070e83537339e596dadc0051491b60b543897 100644 (file)
 
 /* specification: RFC 2205 */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -113,6 +112,13 @@ static const struct tok rsvp_header_flag_values[] = {
     { 0, NULL}
 };
 
+static const struct tok rsvp_obj_capability_flag_values[] = {
+    { 0x0004,                "RecoveryPath Transmit Enabled" },
+    { 0x0002,                "RecoveryPath Desired" },
+    { 0x0001,                "RecoveryPath Srefresh Capable" },
+    { 0, NULL}
+};
+
 #define        RSVP_OBJ_SESSION            1   /* rfc2205 */
 #define        RSVP_OBJ_RSVP_HOP           3   /* rfc2205, rfc3473 */
 #define        RSVP_OBJ_INTEGRITY          4   /* rfc2747 */
@@ -146,6 +152,7 @@ static const struct tok rsvp_header_flag_values[] = {
 #define        RSVP_OBJ_SUGGESTED_LABEL    129 /* rfc3473 */
 #define        RSVP_OBJ_ACCEPT_LABEL_SET   130 /* rfc3473 */
 #define        RSVP_OBJ_RESTART_CAPABILITY 131 /* rfc3473 */
+#define RSVP_OBJ_CAPABILITY         134 /* rfc5063 */
 #define        RSVP_OBJ_NOTIFY_REQ         195 /* rfc3473 */
 #define        RSVP_OBJ_ADMIN_STATUS       196 /* rfc3473 */
 #define        RSVP_OBJ_PROPERTIES         204 /* juniper proprietary */
@@ -193,6 +200,7 @@ static const struct tok rsvp_obj_values[] = {
     { RSVP_OBJ_CALL_ID,            "Call-ID" },
     { RSVP_OBJ_CALL_OPS,           "Call Capability" },
     { RSVP_OBJ_RESTART_CAPABILITY, "Restart Capability" },
+    { RSVP_OBJ_CAPABILITY,         "Capability" },
     { RSVP_OBJ_NOTIFY_REQ,         "Notify Request" },
     { RSVP_OBJ_PROTECTION,         "Protection" },
     { RSVP_OBJ_ADMIN_STATUS,       "Administrative Status" },
@@ -280,6 +288,7 @@ static const struct tok rsvp_ctype_values[] = {
     { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_3,                  "IPv4 plus opt. TLVs" },
     { 256*RSVP_OBJ_ERROR_SPEC+RSVP_CTYPE_4,                  "IPv6 plus opt. TLVs" },
     { 256*RSVP_OBJ_RESTART_CAPABILITY+RSVP_CTYPE_1,          "IPv4" },
+    { 256*RSVP_OBJ_CAPABILITY+RSVP_CTYPE_1,                  "1" },
     { 256*RSVP_OBJ_SESSION_ATTRIBUTE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
     { 256*RSVP_OBJ_FASTREROUTE+RSVP_CTYPE_TUNNEL_IPV4,       "Tunnel IPv4" }, /* old style*/
     { 256*RSVP_OBJ_FASTREROUTE+RSVP_CTYPE_1,                 "1" }, /* new style */
@@ -295,12 +304,20 @@ static const struct tok rsvp_ctype_values[] = {
     { 0, NULL}
 };
 
+/*
+ * XXX - this assumes a 16-byte digest, which is true for HMAC-MD5, but
+ * isn't necessarily the case for other hash algorithms.
+ *
+ * Unless I've missed something, there's nothing in RFC 2747 to indicate
+ * the hash algorithm being used, so it's presumably something set up
+ * out-of-band, or negotiated by other RSVP objects.
+ */
 struct rsvp_obj_integrity_t {
-    uint8_t flags;
-    uint8_t res;
-    uint8_t key_id[6];
-    uint8_t sequence[8];
-    uint8_t digest[16];
+    nd_uint8_t flags;
+    nd_uint8_t res;
+    nd_byte    key_id[6];
+    nd_byte    sequence[8];
+    nd_byte    digest[16];
 };
 
 static const struct tok rsvp_obj_integrity_flag_values[] = {
@@ -309,20 +326,22 @@ static const struct tok rsvp_obj_integrity_flag_values[] = {
 };
 
 struct rsvp_obj_frr_t {
-    uint8_t setup_prio;
-    uint8_t hold_prio;
-    uint8_t hop_limit;
-    uint8_t flags;
-    uint8_t bandwidth[4];
-    uint8_t include_any[4];
-    uint8_t exclude_any[4];
-    uint8_t include_all[4];
+    nd_uint8_t  setup_prio;
+    nd_uint8_t  hold_prio;
+    nd_uint8_t  hop_limit;
+    nd_uint8_t  flags;
+    nd_float    bandwidth;
+    nd_uint32_t include_any;
+    nd_uint32_t exclude_any;
+    nd_uint32_t include_all;
 };
 
 
 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x)   ((x)&0x7f)
 #define RSVP_OBJ_XRO_MASK_LOOSE(x)    ((x)&0x80)
 
+#define RSVP_OBJ_CAPABILITY_FLAGS_MASK  0x7U
+
 #define        RSVP_OBJ_XRO_RES       0
 #define        RSVP_OBJ_XRO_IPV4      1
 #define        RSVP_OBJ_XRO_IPV6      2
@@ -440,7 +459,7 @@ static const struct tok rsvp_obj_error_code_diffserv_te_values[] = {
     { 6,                      "CT/setup priority and CT/holding priority do not form a configured TE-Class" },
     { 7,                      "Inconsistency between signaled PSC and signaled CT" },
     { 8,                      "Inconsistency between signaled PHBs and signaled CT" },
-   { 0, NULL}
+    { 0, NULL}
 };
 
 /* rfc3473 / rfc 3471 */
@@ -490,19 +509,12 @@ static const struct tok rsvp_obj_generalized_uni_values[] = {
  */
 static u_int
 rsvp_intserv_print(netdissect_options *ndo,
-                   const u_char *tptr, u_short obj_tlen)
+                   const u_char *tptr, u_int obj_tlen)
 {
     u_int parameter_id,parameter_length;
-    union {
-       float f;
-       uint32_t i;
-    } bw;
 
-    if (obj_tlen < 4)
-        return 0;
-    ND_TCHECK_1(tptr);
+    ND_ICHECK_U(obj_tlen, <, 4);
     parameter_id = GET_U_1(tptr);
-    ND_TCHECK_2(tptr + 2);
     parameter_length = GET_BE_U_2(tptr + 2)<<2; /* convert wordcount to bytecount */
 
     ND_PRINT("\n\t      Parameter ID: %s (%u), length: %u, Flags: [0x%02x]",
@@ -511,8 +523,7 @@ rsvp_intserv_print(netdissect_options *ndo,
            parameter_length,
            GET_U_1(tptr + 1));
 
-    if (obj_tlen < parameter_length+4)
-        return 0;
+    ND_ICHECK_U(obj_tlen, <, parameter_length + 4);
     switch(parameter_id) { /* parameter_id */
 
     case 4:
@@ -524,7 +535,6 @@ rsvp_intserv_print(netdissect_options *ndo,
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */
         if (parameter_length == 4) {
-           ND_TCHECK_4(tptr + 4);
             ND_PRINT("\n\t\tIS hop count: %u", GET_BE_U_4(tptr + 4));
         }
         break;
@@ -538,9 +548,8 @@ rsvp_intserv_print(netdissect_options *ndo,
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */
         if (parameter_length == 4) {
-           ND_TCHECK_4(tptr + 4);
-            bw.i = GET_BE_U_4(tptr + 4);
-            ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw.f / 125000);
+            ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps",
+                     GET_BE_F_4(tptr + 4) / 125000);
         }
         break;
 
@@ -553,7 +562,6 @@ rsvp_intserv_print(netdissect_options *ndo,
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */
         if (parameter_length == 4) {
-           ND_TCHECK_4(tptr + 4);
             ND_PRINT("\n\t\tMinimum path latency: ");
             if (GET_BE_U_4(tptr + 4) == 0xffffffff)
                 ND_PRINT("don't care");
@@ -572,7 +580,6 @@ rsvp_intserv_print(netdissect_options *ndo,
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         */
         if (parameter_length == 4) {
-           ND_TCHECK_4(tptr + 4);
             ND_PRINT("\n\t\tComposed MTU: %u bytes", GET_BE_U_4(tptr + 4));
         }
         break;
@@ -594,13 +601,12 @@ rsvp_intserv_print(netdissect_options *ndo,
         */
 
         if (parameter_length == 20) {
-           ND_TCHECK_LEN(tptr + 4, 20);
-            bw.i = GET_BE_U_4(tptr + 4);
-            ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw.f / 125000);
-            bw.i = GET_BE_U_4(tptr + 8);
-            ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw.f);
-            bw.i = GET_BE_U_4(tptr + 12);
-            ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw.f / 125000);
+            ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps",
+                     GET_BE_F_4(tptr + 4) / 125000);
+            ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes",
+                     GET_BE_F_4(tptr + 8));
+            ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps",
+                     GET_BE_F_4(tptr + 12) / 125000);
             ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes",
                      GET_BE_U_4(tptr + 16));
             ND_PRINT("\n\t\tMaximum Packet Size: %u bytes",
@@ -620,9 +626,7 @@ rsvp_intserv_print(netdissect_options *ndo,
         */
 
         if (parameter_length == 8) {
-           ND_TCHECK_8(tptr + 4);
-            bw.i = GET_BE_U_4(tptr + 4);
-            ND_PRINT("\n\t\tRate: %.10g Mbps", bw.f / 125000);
+            ND_PRINT("\n\t\tRate: %.10g Mbps", GET_BE_F_4(tptr + 4) / 125000);
             ND_PRINT("\n\t\tSlack Term: %u", GET_BE_U_4(tptr + 8));
         }
         break;
@@ -632,7 +636,6 @@ rsvp_intserv_print(netdissect_options *ndo,
     case 135:
     case 136:
         if (parameter_length == 4) {
-           ND_TCHECK_4(tptr + 4);
             ND_PRINT("\n\t\tValue: %u", GET_BE_U_4(tptr + 4));
         }
         break;
@@ -643,8 +646,8 @@ rsvp_intserv_print(netdissect_options *ndo,
     }
     return (parameter_length+4); /* header length 4 bytes */
 
-trunc:
-    nd_print_trunc(ndo);
+invalid:
+    nd_print_invalid(ndo);
     return 0;
 }
 
@@ -676,19 +679,12 @@ rsvp_obj_print(netdissect_options *ndo,
     u_short rsvp_obj_len,rsvp_obj_ctype,rsvp_obj_class_num;
     u_int obj_tlen,intserv_serv_tlen;
     int hexdump;
-    u_int processed,padbytes,error_code,error_value,i,sigcheck;
-    union {
-       float f;
-       uint32_t i;
-    } bw;
-    uint8_t namelen;
+    u_int processed,padbytes,error_code,error_value,sigcheck;
+    u_int namelen;
 
     u_int action, subchannel;
 
     while(tlen>=sizeof(struct rsvp_object_header)) {
-        /* did we capture enough for fully decoding the object header ? */
-        ND_TCHECK_LEN(tptr, sizeof(struct rsvp_object_header));
-
         rsvp_obj_header = (const struct rsvp_object_header *)tptr;
         rsvp_obj_len=GET_BE_U_2(rsvp_obj_header->length);
         rsvp_obj_ctype=GET_U_1(rsvp_obj_header->ctype);
@@ -698,8 +694,8 @@ rsvp_obj_print(netdissect_options *ndo,
             return -1;
         }
         if(rsvp_obj_len < sizeof(struct rsvp_object_header)) {
-            ND_PRINT("%sERROR: object header too short %u < %lu", indent, rsvp_obj_len,
-                   (unsigned long)sizeof(struct rsvp_object_header));
+            ND_PRINT("%sERROR: object header too short %u < %zu", indent, rsvp_obj_len,
+                   sizeof(struct rsvp_object_header));
             return -1;
         }
 
@@ -739,10 +735,10 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 8)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 DestAddress: %s, Protocol ID: 0x%02x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_U_1(obj_tptr + sizeof(nd_ipv4)));
                 ND_PRINT("%s  Flags: [0x%02x], DestPort %u",
                        indent,
@@ -753,10 +749,10 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 20)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 DestAddress: %s, Protocol ID: 0x%02x",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_U_1(obj_tptr + sizeof(nd_ipv6)));
                 ND_PRINT("%s  Flags: [0x%02x], DestPort %u",
                        indent,
@@ -768,47 +764,47 @@ rsvp_obj_print(netdissect_options *ndo,
 
             case RSVP_CTYPE_TUNNEL_IPV6:
                 if (obj_tlen < 36)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18),
-                       ip6addr_string(ndo, obj_tptr + 20));
+                       GET_IP6ADDR_STRING(obj_tptr + 20));
                 obj_tlen-=36;
                 obj_tptr+=36;
                 break;
 
             case RSVP_CTYPE_14: /* IPv6 p2mp LSP Tunnel */
                 if (obj_tlen < 26)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
                        indent,
                        GET_BE_U_4(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6),
-                       ip6addr_string(ndo, obj_tptr + 8));
+                       GET_IP6ADDR_STRING(obj_tptr + 8));
                 obj_tlen-=26;
                 obj_tptr+=26;
                 break;
             case RSVP_CTYPE_13: /* IPv4 p2mp LSP Tunnel */
                 if (obj_tlen < 12)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6),
-                       ipaddr_string(ndo, obj_tptr + 8));
+                       GET_IPADDR_STRING(obj_tptr + 8));
                 obj_tlen-=12;
                 obj_tptr+=12;
                 break;
             case RSVP_CTYPE_TUNNEL_IPV4:
             case RSVP_CTYPE_UNI_IPV4:
                 if (obj_tlen < 12)
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6),
-                       ipaddr_string(ndo, obj_tptr + 8));
+                       GET_IPADDR_STRING(obj_tptr + 8));
                 obj_tlen-=12;
                 obj_tptr+=12;
                 break;
@@ -821,19 +817,19 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < sizeof(nd_ipv4))
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Receiver Address: %s",
                        indent,
-                       ipaddr_string(ndo, obj_tptr));
+                       GET_IPADDR_STRING(obj_tptr));
                 obj_tlen-=sizeof(nd_ipv4);
                 obj_tptr+=sizeof(nd_ipv4);
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < sizeof(nd_ipv6))
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 Receiver Address: %s",
                        indent,
-                       ip6addr_string(ndo, obj_tptr));
+                       GET_IP6ADDR_STRING(obj_tptr));
                 obj_tlen-=sizeof(nd_ipv6);
                 obj_tptr+=sizeof(nd_ipv6);
                 break;
@@ -846,19 +842,19 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < sizeof(nd_ipv4))
-                    return -1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Notify Node Address: %s",
                        indent,
-                       ipaddr_string(ndo, obj_tptr));
+                       GET_IPADDR_STRING(obj_tptr));
                 obj_tlen-=sizeof(nd_ipv4);
                 obj_tptr+=sizeof(nd_ipv4);
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < sizeof(nd_ipv6))
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 Notify Node Address: %s",
                        indent,
-                       ip6addr_string(ndo, obj_tptr));
+                       GET_IP6ADDR_STRING(obj_tptr));
                 obj_tlen-=sizeof(nd_ipv6);
                 obj_tptr+=sizeof(nd_ipv6);
                 break;
@@ -881,7 +877,7 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_2:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Generalized Label: %u",
                        indent,
                        GET_BE_U_4(obj_tptr));
@@ -890,7 +886,7 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_3:
                 if (obj_tlen < 12)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Waveband ID: %u%s  Start Label: %u, Stop Label: %u",
                        indent,
                        GET_BE_U_4(obj_tptr),
@@ -909,7 +905,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Reservation Style: %s, Flags: [0x%02x]",
                        indent,
                        tok2str(rsvp_resstyle_values,
@@ -928,58 +924,58 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, Source Port: %u",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6));
                 obj_tlen-=8;
                 obj_tptr+=8;
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, Source Port: %u",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18));
                 obj_tlen-=20;
                 obj_tptr+=20;
                 break;
             case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
                 if (obj_tlen < 40)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
                        "%s  Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18),
                        indent,
-                       ip6addr_string(ndo, obj_tptr+20),
+                       GET_IP6ADDR_STRING(obj_tptr+20),
                        GET_BE_U_2(obj_tptr + 38));
                 obj_tlen-=40;
                 obj_tptr+=40;
                 break;
             case RSVP_CTYPE_TUNNEL_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6));
                 obj_tlen-=8;
                 obj_tptr+=8;
                 break;
             case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
                 if (obj_tlen < 16)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
                        "%s  Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6),
                        indent,
-                       ipaddr_string(ndo, obj_tptr+8),
+                       GET_IPADDR_STRING(obj_tptr+8),
                        GET_BE_U_2(obj_tptr + 12));
                 obj_tlen-=16;
                 obj_tptr+=16;
@@ -1004,7 +1000,7 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_2:
                 if (obj_tlen < 12)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  L3 Protocol ID: %s",
                        indent,
                        tok2str(ethertype_values,
@@ -1025,7 +1021,7 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_3:
                 if (obj_tlen < 12)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  L3 Protocol ID: %s",
                        indent,
                        tok2str(ethertype_values,
@@ -1042,7 +1038,7 @@ rsvp_obj_print(netdissect_options *ndo,
                 break;
             case RSVP_CTYPE_4:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  LSP Encoding Type: %s (%u)",
                        indent,
                        tok2str(gmpls_encoding_values,
@@ -1109,7 +1105,7 @@ rsvp_obj_print(netdissect_options *ndo,
                        }
                         ND_PRINT(", %s, %s/%u, Flags: [%s]",
                                RSVP_OBJ_XRO_MASK_LOOSE(GET_U_1(obj_tptr)) ? "Loose" : "Strict",
-                               ipaddr_string(ndo, obj_tptr+2),
+                               GET_IPADDR_STRING(obj_tptr+2),
                                GET_U_1((obj_tptr + 6)),
                                bittok2str(rsvp_obj_rro_flag_values,
                                    "none",
@@ -1120,7 +1116,6 @@ rsvp_obj_print(netdissect_options *ndo,
                                ND_PRINT(" ERROR: length != 8");
                                goto invalid;
                        }
-                       ND_TCHECK_8(obj_tptr);
                         ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
                                bittok2str(rsvp_obj_rro_label_flag_values,
                                    "none",
@@ -1146,7 +1141,7 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_1:
             case RSVP_CTYPE_2:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Instance: 0x%08x, Destination Instance: 0x%08x",
                        indent,
                        GET_BE_U_4(obj_tptr),
@@ -1163,7 +1158,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Restart  Time: %ums, Recovery Time: %ums",
                        indent,
                        GET_BE_U_4(obj_tptr),
@@ -1176,17 +1171,38 @@ rsvp_obj_print(netdissect_options *ndo,
             }
             break;
 
+        case RSVP_OBJ_CAPABILITY:
+            switch(rsvp_obj_ctype) {
+            case RSVP_CTYPE_1:
+                if (obj_tlen < 4)
+                    goto obj_tooshort;
+                uint32_t unused_and_flags = GET_BE_U_4(obj_tptr);
+                if (unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK)
+                    ND_PRINT("%s  [reserved=0x%08x must be zero]", indent,
+                        unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK);
+                ND_PRINT("%s  Flags: [%s]",
+                       indent,
+                       bittok2str(rsvp_obj_capability_flag_values,
+                                  "none",
+                                  (unused_and_flags & RSVP_OBJ_CAPABILITY_FLAGS_MASK)));
+                obj_tlen-=4;
+                obj_tptr+=4;
+                break;
+            default:
+                hexdump=TRUE;
+            }
+            break;
+
         case RSVP_OBJ_SESSION_ATTRIBUTE:
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_TUNNEL_IPV4:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 namelen = GET_U_1(obj_tptr + 3);
                 if (obj_tlen < 4+namelen)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Session Name: ", indent);
-                for (i = 0; i < namelen; i++)
-                    fn_print_char(ndo, GET_U_1(obj_tptr + 4 + i));
+                nd_printjn(ndo, obj_tptr + 4, namelen);
                 ND_PRINT("%s  Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
                        indent,
                        GET_U_1(obj_tptr),
@@ -1210,11 +1226,11 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_1:
 
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
 
                /* read variable length subobjects */
                total_subobj_len = obj_tlen;
-                while(total_subobj_len > 0) {
+                while(total_subobj_len != 0) {
                     /* If RFC 3476 Section 3.1 defined that a sub-object of the
                      * GENERALIZED_UNI RSVP object must have the Length field as
                      * a multiple of 4, instead of the check below it would be
@@ -1224,8 +1240,7 @@ rsvp_obj_print(netdissect_options *ndo,
                      * each iteration subobj_len may happen to be a multiple of 1
                      * and test it and total_subobj_len respectively.
                      */
-                    if (total_subobj_len < 4)
-                        goto invalid;
+                    ND_ICHECK_U(total_subobj_len, <, 4);
                     subobj_len  = GET_BE_U_2(obj_tptr);
                     subobj_type = (GET_BE_U_2(obj_tptr + 2))>>8;
                     af = (GET_BE_U_2(obj_tptr + 2))&0x00FF;
@@ -1253,7 +1268,7 @@ rsvp_obj_print(netdissect_options *ndo,
                      *
                      * but that doesn't work; the new URL appears to be
                      *
-                     *    http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
+                     *    https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf
                      *
                      * and *that* document, in section 12.5.2.3
                      * "GENERALIZED_UNI Object (Class-Num=11bbbbbb (TBA))",
@@ -1272,17 +1287,17 @@ rsvp_obj_print(netdissect_options *ndo,
                     case RSVP_GEN_UNI_SUBOBJ_DESTINATION_TNA_ADDRESS:
 
                         switch(af) {
-                        case AFNUM_INET:
+                        case AFNUM_IP:
                             if (subobj_len < 8)
-                                return -1;
+                                goto subobj_tooshort;
                             ND_PRINT("%s    UNI IPv4 TNA address: %s",
-                                   indent, ipaddr_string(ndo, obj_tptr + 4));
+                                   indent, GET_IPADDR_STRING(obj_tptr + 4));
                             break;
-                        case AFNUM_INET6:
+                        case AFNUM_IP6:
                             if (subobj_len < 20)
-                                return -1;
+                                goto subobj_tooshort;
                             ND_PRINT("%s    UNI IPv6 TNA address: %s",
-                                   indent, ip6addr_string(ndo, obj_tptr + 4));
+                                   indent, GET_IP6ADDR_STRING(obj_tptr + 4));
                             break;
                         case AFNUM_NSAP:
                             if (subobj_len) {
@@ -1302,7 +1317,7 @@ rsvp_obj_print(netdissect_options *ndo,
 
                     case RSVP_GEN_UNI_SUBOBJ_EGRESS_LABEL:
                         if (subobj_len < 16) {
-                            return -1;
+                            goto subobj_tooshort;
                         }
 
                         ND_PRINT("%s    U-bit: %x, Label type: %u, Logical port id: %u, Label: %u",
@@ -1315,7 +1330,7 @@ rsvp_obj_print(netdissect_options *ndo,
 
                     case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL:
                         if (subobj_len < 8) {
-                            return -1;
+                            goto subobj_tooshort;
                         }
 
                         ND_PRINT("%s    Service level: %u",
@@ -1342,10 +1357,10 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_4(obj_tptr + 4));
                 obj_tlen-=8;
                 obj_tptr+=8;
@@ -1355,10 +1370,10 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Previous/Next Interface: %s, Logical Interface Handle: 0x%08x",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_4(obj_tptr + 16));
                 obj_tlen-=20;
                 obj_tptr+=20;
@@ -1373,7 +1388,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Refresh Period: %ums",
                        indent,
                        GET_BE_U_4(obj_tptr));
@@ -1392,7 +1407,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_2:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Msg-Version: %u, length: %u",
                        indent,
                        (GET_U_1(obj_tptr) & 0xf0) >> 4,
@@ -1431,78 +1446,78 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, Source Port: %u",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6));
                 obj_tlen-=8;
                 obj_tptr+=8;
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, Source Port: %u",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18));
                 obj_tlen-=20;
                 obj_tptr+=20;
                 break;
             case RSVP_CTYPE_3:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, Flow Label: %u",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_3(obj_tptr + 17));
                 obj_tlen-=20;
                 obj_tptr+=20;
                 break;
             case RSVP_CTYPE_TUNNEL_IPV6:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, LSP-ID: 0x%04x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18));
                 obj_tlen-=20;
                 obj_tptr+=20;
                 break;
             case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
                 if (obj_tlen < 40)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
                        "%s  Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 18),
                        indent,
-                       ip6addr_string(ndo, obj_tptr+20),
+                       GET_IP6ADDR_STRING(obj_tptr+20),
                        GET_BE_U_2(obj_tptr + 38));
                 obj_tlen-=40;
                 obj_tptr+=40;
                 break;
             case RSVP_CTYPE_TUNNEL_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Source Address: %s, LSP-ID: 0x%04x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6));
                 obj_tlen-=8;
                 obj_tptr+=8;
                 break;
             case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
                 if (obj_tlen < 16)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
                        "%s  Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_BE_U_2(obj_tptr + 6),
                        indent,
-                       ipaddr_string(ndo, obj_tptr+8),
+                       GET_IPADDR_STRING(obj_tptr+8),
                        GET_BE_U_2(obj_tptr + 12));
                 obj_tlen-=16;
                 obj_tptr+=16;
@@ -1519,14 +1534,13 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1: /* new style */
                 if (obj_tlen < sizeof(struct rsvp_obj_frr_t))
-                    return-1;
-                bw.i = GET_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth);
+                    goto obj_tooshort;
                 ND_PRINT("%s  Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
                        indent,
-                       obj_ptr.rsvp_obj_frr->setup_prio,
-                       obj_ptr.rsvp_obj_frr->hold_prio,
-                       obj_ptr.rsvp_obj_frr->hop_limit,
-                       bw.f * 8 / 1000000);
+                       GET_U_1(obj_ptr.rsvp_obj_frr->setup_prio),
+                       GET_U_1(obj_ptr.rsvp_obj_frr->hold_prio),
+                       GET_U_1(obj_ptr.rsvp_obj_frr->hop_limit),
+                       GET_BE_F_4(obj_ptr.rsvp_obj_frr->bandwidth) * 8 / 1000000);
                 ND_PRINT("%s  Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x",
                        indent,
                        GET_BE_U_4(obj_ptr.rsvp_obj_frr->include_any),
@@ -1538,14 +1552,13 @@ rsvp_obj_print(netdissect_options *ndo,
 
             case RSVP_CTYPE_TUNNEL_IPV4: /* old style */
                 if (obj_tlen < 16)
-                    return-1;
-                bw.i = GET_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth);
+                    goto obj_tooshort;
                 ND_PRINT("%s  Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps",
                        indent,
-                       obj_ptr.rsvp_obj_frr->setup_prio,
-                       obj_ptr.rsvp_obj_frr->hold_prio,
-                       obj_ptr.rsvp_obj_frr->hop_limit,
-                       bw.f * 8 / 1000000);
+                       GET_U_1(obj_ptr.rsvp_obj_frr->setup_prio),
+                       GET_U_1(obj_ptr.rsvp_obj_frr->hold_prio),
+                       GET_U_1(obj_ptr.rsvp_obj_frr->hop_limit),
+                       GET_BE_F_4(obj_ptr.rsvp_obj_frr->bandwidth) * 8 / 1000000);
                 ND_PRINT("%s  Include Colors: 0x%08x, Exclude Colors: 0x%08x",
                        indent,
                        GET_BE_U_4(obj_ptr.rsvp_obj_frr->include_any),
@@ -1565,8 +1578,8 @@ rsvp_obj_print(netdissect_options *ndo,
                 while(obj_tlen >= 8) {
                     ND_PRINT("%s  PLR-ID: %s, Avoid-Node-ID: %s",
                            indent,
-                           ipaddr_string(ndo, obj_tptr),
-                           ipaddr_string(ndo, obj_tptr + 4));
+                           GET_IPADDR_STRING(obj_tptr),
+                           GET_IPADDR_STRING(obj_tptr + 4));
                     obj_tlen-=8;
                     obj_tptr+=8;
                 }
@@ -1580,6 +1593,8 @@ rsvp_obj_print(netdissect_options *ndo,
         case RSVP_OBJ_CLASSTYPE_OLD: /* fall through */
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
+                if (obj_tlen < 4)
+                    goto obj_tooshort;
                 ND_PRINT("%s  CT: %u",
                        indent,
                        GET_BE_U_4(obj_tptr) & 0x7);
@@ -1596,12 +1611,12 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_3: /* fall through - FIXME add TLV parser */
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 8)
-                    return-1;
+                    goto obj_tooshort;
                 error_code=GET_U_1(obj_tptr + 5);
                 error_value=GET_BE_U_2(obj_tptr + 6);
                 ND_PRINT("%s  Error Node Address: %s, Flags: [0x%02x]%s  Error Code: %s (%u)",
                        indent,
-                       ipaddr_string(ndo, obj_tptr),
+                       GET_IPADDR_STRING(obj_tptr),
                        GET_U_1(obj_tptr + 4),
                        indent,
                        tok2str(rsvp_obj_error_code_values,"unknown",error_code),
@@ -1628,12 +1643,12 @@ rsvp_obj_print(netdissect_options *ndo,
             case RSVP_CTYPE_4: /* fall through - FIXME add TLV parser */
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 20)
-                    return-1;
+                    goto obj_tooshort;
                 error_code=GET_U_1(obj_tptr + 17);
                 error_value=GET_BE_U_2(obj_tptr + 18);
                 ND_PRINT("%s  Error Node Address: %s, Flags: [0x%02x]%s  Error Code: %s (%u)",
                        indent,
-                       ip6addr_string(ndo, obj_tptr),
+                       GET_IP6ADDR_STRING(obj_tptr),
                        GET_U_1(obj_tptr + 16),
                        indent,
                        tok2str(rsvp_obj_error_code_values,"unknown",error_code),
@@ -1660,7 +1675,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 padbytes = GET_BE_U_2(obj_tptr + 2);
                 ND_PRINT("%s  TLV count: %u, padding bytes: %u",
                        indent,
@@ -1676,9 +1691,11 @@ rsvp_obj_print(netdissect_options *ndo,
                            GET_U_1(obj_tptr),
                            GET_U_1(obj_tptr + 1));
                     if (obj_tlen < GET_U_1(obj_tptr + 1))
-                        return-1;
-                    if (GET_U_1(obj_tptr + 1) < 2)
+                        goto obj_tooshort;
+                    if (GET_U_1(obj_tptr + 1) < 2) {
+                        ND_PRINT("%sERROR: property TLV is too short", indent);
                         return -1;
+                    }
                     print_unknown_data(ndo, obj_tptr + 2, "\n\t\t",
                                        GET_U_1(obj_tptr + 1) - 2);
                     obj_tlen-=GET_U_1(obj_tptr + 1);
@@ -1696,8 +1713,8 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
             case RSVP_CTYPE_2:
-                if (obj_tlen < 8)
-                    return-1;
+                if (obj_tlen < 4)
+                    goto obj_tooshort;
                 ND_PRINT("%s  Flags [0x%02x], epoch: %u",
                        indent,
                        GET_U_1(obj_tptr),
@@ -1723,7 +1740,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < sizeof(struct rsvp_obj_integrity_t))
-                    return-1;
+                    goto obj_tooshort;
                 obj_ptr.rsvp_obj_integrity = (const struct rsvp_obj_integrity_t *)obj_tptr;
                 ND_PRINT("%s  Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]",
                        indent,
@@ -1733,7 +1750,7 @@ rsvp_obj_print(netdissect_options *ndo,
                        GET_BE_U_4(obj_ptr.rsvp_obj_integrity->sequence + 4),
                        bittok2str(rsvp_obj_integrity_flag_values,
                                   "none",
-                                  obj_ptr.rsvp_obj_integrity->flags));
+                                  GET_U_1(obj_ptr.rsvp_obj_integrity->flags)));
                 ND_PRINT("%s  MD5-sum 0x%08x%08x%08x%08x ",
                        indent,
                        GET_BE_U_4(obj_ptr.rsvp_obj_integrity->digest),
@@ -1759,7 +1776,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Flags [%s]", indent,
                        bittok2str(rsvp_obj_admin_status_flag_values, "none",
                                   GET_BE_U_4(obj_tptr)));
@@ -1775,7 +1792,7 @@ rsvp_obj_print(netdissect_options *ndo,
             switch(rsvp_obj_ctype) {
             case RSVP_CTYPE_1:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 action = (GET_BE_U_2(obj_tptr)>>8);
 
                 ND_PRINT("%s  Action: %s (%u), Label type: %u", indent,
@@ -1788,7 +1805,7 @@ rsvp_obj_print(netdissect_options *ndo,
 
                    /* only a couple of subchannels are expected */
                    if (obj_tlen < 12)
-                       return -1;
+                       goto obj_tooshort;
                    ND_PRINT("%s  Start range: %u, End range: %u", indent,
                            GET_BE_U_4(obj_tptr + 4),
                            GET_BE_U_4(obj_tptr + 8));
@@ -1819,18 +1836,18 @@ rsvp_obj_print(netdissect_options *ndo,
             switch (rsvp_obj_ctype) {
             case RSVP_CTYPE_IPV4:
                 if (obj_tlen < 4)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Sub-LSP destination address: %s",
-                       indent, ipaddr_string(ndo, obj_tptr));
+                       indent, GET_IPADDR_STRING(obj_tptr));
 
                 obj_tlen-=4;
                 obj_tptr+=4;
                 break;
             case RSVP_CTYPE_IPV6:
                 if (obj_tlen < 16)
-                    return-1;
+                    goto obj_tooshort;
                 ND_PRINT("%s  Sub-LSP destination address: %s",
-                       indent, ip6addr_string(ndo, obj_tptr));
+                       indent, GET_IP6ADDR_STRING(obj_tptr));
 
                 obj_tlen-=16;
                 obj_tptr+=16;
@@ -1863,12 +1880,15 @@ rsvp_obj_print(netdissect_options *ndo,
         tlen-=rsvp_obj_len;
     }
     return 0;
+subobj_tooshort:
+    ND_PRINT("%sERROR: sub-object is too short", indent);
+    return -1;
+obj_tooshort:
+    ND_PRINT("%sERROR: object is too short", indent);
+    return -1;
 invalid:
     nd_print_invalid(ndo);
     return -1;
-trunc:
-    nd_print_trunc(ndo);
-    return -1;
 }
 
 void
@@ -1921,8 +1941,8 @@ rsvp_print(netdissect_options *ndo,
            GET_BE_U_2(rsvp_com_header->checksum));
 
     if (tlen < sizeof(struct rsvp_common_header)) {
-        ND_PRINT("ERROR: common header too short %u < %lu", tlen,
-               (unsigned long)sizeof(struct rsvp_common_header));
+        ND_PRINT("ERROR: common header too short %u < %zu", tlen,
+               sizeof(struct rsvp_common_header));
         return;
     }
 
@@ -1937,7 +1957,7 @@ rsvp_print(netdissect_options *ndo,
          * Bundle messages may not contain bundle submessages, so we don't
          * need to handle bundle submessages specially.
          */
-        while(tlen > 0) {
+        while(tlen != 0) {
             const u_char *subpptr=tptr, *subtptr;
             u_short subplen, subtlen;
 
@@ -1969,8 +1989,8 @@ rsvp_print(netdissect_options *ndo,
                    GET_BE_U_2(rsvp_com_header->checksum));
 
             if (subtlen < sizeof(struct rsvp_common_header)) {
-                ND_PRINT("ERROR: common header too short %u < %lu", subtlen,
-                       (unsigned long)sizeof(struct rsvp_common_header));
+                ND_PRINT("ERROR: common header too short %u < %zu", subtlen,
+                       sizeof(struct rsvp_common_header));
                 return;
             }
 
@@ -2017,8 +2037,4 @@ rsvp_print(netdissect_options *ndo,
         print_unknown_data(ndo, tptr, "\n\t    ", tlen);
         break;
     }
-
-    return;
-trunc:
-    nd_print_trunc(ndo);
 }