]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
Add CAP_FCNTL and use cap_fcntls_limit().
[tcpdump] / print-bootp.c
index 7f42492d4188d29446c2ddf418a575caa87adfaf..fe0a070ca093a0fb26742fb5a8145f27f92620d4 100644 (file)
@@ -195,6 +195,8 @@ struct bootp {
 /* RFC 3442 */
 #define TAG_CLASSLESS_STATIC_RT        ((uint8_t) 121)
 #define TAG_CLASSLESS_STA_RT_MS        ((uint8_t) 249)
+/* RFC 5859 - TFTP Server Address Option for DHCPv4 */
+#define        TAG_TFTP_SERVER_ADDRESS ((uint8_t) 150)
 /* ftp://ftp.isi.edu/.../assignments/bootp-dhcp-extensions */
 #define        TAG_SLP_NAMING_AUTH     ((uint8_t)  80)
 #define        TAG_CLIENT_FQDN         ((uint8_t)  81)
@@ -500,6 +502,8 @@ static const struct tok tag2str[] = {
 /* RFC 3442 */
        { TAG_CLASSLESS_STATIC_RT, "$Classless-Static-Route" },
        { TAG_CLASSLESS_STA_RT_MS, "$Classless-Static-Route-Microsoft" },
+/* RFC 5859 - TFTP Server Address Option for DHCPv4 */
+       { TAG_TFTP_SERVER_ADDRESS, "iTFTP-Server-Address" },
 /* http://www.iana.org/assignments/bootp-dhcp-extensions/index.htm */
        { TAG_SLP_NAMING_AUTH,  "aSLP-NA" },
        { TAG_CLIENT_FQDN,      "$FQDN" },
@@ -847,7 +851,7 @@ rfc1048_print(netdissect_options *ndo,
 
                        case TAG_CLIENT_ID:
                            {
-                               int type;
+                               int type;
 
                                /* this option should be at least 1 byte long */
                                if (len < 1) {
@@ -903,7 +907,8 @@ rfc1048_print(netdissect_options *ndo,
                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
                                        case AGENT_SUBOPTION_REMOTE_ID:
                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
-                                               fn_printn(ndo, bp, suboptlen, NULL);
+                                               if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend))
+                                                       goto trunc;
                                                break;
 
                                        default: