]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rsvp.c
Revert partially the commit 21b1273
[tcpdump] / print-rsvp.c
index 4254881dc45c6fc1ffebe627514b28d342b44239..23b6d5a77386b7542ef3cf8223bf05b3bf717c11 100644 (file)
@@ -305,6 +305,14 @@ 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;
@@ -333,7 +341,7 @@ struct rsvp_obj_frr_t {
 #define RSVP_OBJ_XRO_MASK_SUBOBJ(x)   ((x)&0x7f)
 #define RSVP_OBJ_XRO_MASK_LOOSE(x)    ((x)&0x80)
 
-#define RSVP_OBJ_CAPABILITY_FLAGS_MASK  0x7
+#define RSVP_OBJ_CAPABILITY_FLAGS_MASK  0x7U
 
 #define        RSVP_OBJ_XRO_RES       0
 #define        RSVP_OBJ_XRO_IPV4      1
@@ -512,9 +520,7 @@ rsvp_intserv_print(netdissect_options *ndo,
 
     if (obj_tlen < 4)
         return 0;
-    ND_TCHECK_1(tptr);
     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]",
@@ -536,7 +542,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;
@@ -550,7 +555,6 @@ 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);
         }
@@ -565,7 +569,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");
@@ -584,7 +587,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;
@@ -644,7 +646,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;