]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-bootp.c
index ec719494691137042e8ff6ac0d8277f67476170f..0e47ef508f61c8f304056c415cea8ef8f078235e 100644 (file)
@@ -183,6 +183,8 @@ struct bootp {
 /* RFC 2610 */
 #define        TAG_SLP_DA              ((uint8_t)  78)
 #define        TAG_SLP_SCOPE           ((uint8_t)  79)
+/* RFC 8925 */
+#define TAG_IPV6_ONLY_PREFERRED        ((uint8_t) 108)
 /* RFC 2937 */
 #define        TAG_NS_SEARCH           ((uint8_t) 117)
 /* RFC 3004 - The User Class Option for DHCP */
@@ -530,6 +532,7 @@ static const struct tok tag2str[] = {
        { TAG_NETINFO_PARENT_TAG, "aNITAG" },
        { TAG_URL,              "aURL" },
        { TAG_MUDURL,           "aMUD-URL" },
+       { TAG_IPV6_ONLY_PREFERRED, "$IPv6-Only-Preferred" },
        { 0, NULL }
 };
 
@@ -707,6 +710,14 @@ rfc1048_print(netdissect_options *ndo,
 
                case 'p':
                        /* IP address pairs */
+                       /* this option should be N x 8 bytes long */
+                       if (len < 8 || len % 8 != 0) {
+                               ND_PRINT("%s[length != N x 8 bytes]",
+                                        len == 0 ? " " : "");
+                               bp += len;
+                               len = 0;
+                               break;
+                       }
                        while (len >= 2*4) {
                                if (!first)
                                        ND_PRINT(",");
@@ -1049,6 +1060,19 @@ rfc1048_print(netdissect_options *ndo,
                                }
                                break;
 
+                       case TAG_IPV6_ONLY_PREFERRED:
+                               /* this option should be 4 bytes long */
+                               if (len != 4) {
+                                       ND_PRINT("[length != 4 bytes]");
+                                       nd_print_invalid(ndo);
+                                       bp += len;
+                                       len = 0;
+                               }
+                               ND_PRINT("%u", GET_BE_U_4(bp));
+                               bp += 4;
+                               len -= 4;
+                               break;
+
                        default:
                                ND_PRINT("[unknown special tag %u, size %u]",
                                          tag, len);