summaryrefslogtreecommitdiffstats
path: root/print-bootp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
commit7ba700b7f6e5fb17d280e2b8a3ae28866777715f (patch)
tree2f538ff3d975beabb6c371d999b1ee6e8b91cfb5 /print-bootp.c
parentReleasing progress-linux version 4.99.4-4~progress7.99u1. (diff)
downloadtcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.tar.xz
tcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.zip
Merging upstream version 4.99.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--print-bootp.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/print-bootp.c b/print-bootp.c
index d230a24..b20dabc 100644
--- a/print-bootp.c
+++ b/print-bootp.c
@@ -21,9 +21,7 @@
/* \summary: BOOTP and IPv4 DHCP printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
@@ -147,7 +145,7 @@ struct bootp {
#define TAG_NIS_P_DOMAIN ((uint8_t) 64)
#define TAG_NIS_P_SERVERS ((uint8_t) 65)
#define TAG_MOBILE_HOME ((uint8_t) 68)
-#define TAG_SMPT_SERVER ((uint8_t) 69)
+#define TAG_SMTP_SERVER ((uint8_t) 69)
#define TAG_POP3_SERVER ((uint8_t) 70)
#define TAG_NNTP_SERVER ((uint8_t) 71)
#define TAG_WWW_SERVER ((uint8_t) 72)
@@ -193,6 +191,8 @@ struct bootp {
/* RFC 3442 */
#define TAG_CLASSLESS_STATIC_RT ((uint8_t) 121)
#define TAG_CLASSLESS_STA_RT_MS ((uint8_t) 249)
+/* RFC8572 */
+#define TAG_SZTP_REDIRECT ((uint8_t) 143)
/* RFC 5859 - TFTP Server Address Option for DHCPv4 */
#define TAG_TFTP_SERVER_ADDRESS ((uint8_t) 150)
/* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml */
@@ -461,7 +461,7 @@ static const struct tok tag2str[] = {
{ TAG_NIS_P_DOMAIN, "sN+D" },
{ TAG_NIS_P_SERVERS, "iN+S" },
{ TAG_MOBILE_HOME, "iMH" },
- { TAG_SMPT_SERVER, "iSMTP" },
+ { TAG_SMTP_SERVER, "iSMTP" },
{ TAG_POP3_SERVER, "iPOP3" },
{ TAG_NNTP_SERVER, "iNNTP" },
{ TAG_WWW_SERVER, "iWWW" },
@@ -499,6 +499,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 8572 */
+ { TAG_SZTP_REDIRECT, "$SZTP-Redirect" },
/* RFC 5859 - TFTP Server Address Option for DHCPv4 */
{ TAG_TFTP_SERVER_ADDRESS, "iTFTP-Server-Address" },
/* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml#options */
@@ -999,6 +1001,39 @@ rfc1048_print(netdissect_options *ndo,
break;
}
+
+ case TAG_SZTP_REDIRECT:
+ /* as per https://datatracker.ietf.org/doc/html/rfc8572#section-8.3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
+ | uri-length | URI |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
+
+ * uri-length: 2 octets long; specifies the length of the URI data.
+ * URI: URI of the SZTP bootstrap server.
+ */
+ while (len >= 2) {
+ suboptlen = GET_BE_U_2(bp);
+ bp += 2;
+ len -= 2;
+ ND_PRINT("\n\t ");
+ ND_PRINT("length %u: ", suboptlen);
+ if (len < suboptlen) {
+ ND_PRINT("length goes past end of option");
+ bp += len;
+ len = 0;
+ break;
+ }
+ ND_PRINT("\"");
+ nd_printjn(ndo, bp, suboptlen);
+ ND_PRINT("\"");
+ len -= suboptlen;
+ bp += suboptlen;
+ }
+ if (len != 0) {
+ ND_PRINT("[ERROR: length < 2 bytes]");
+ }
+ break;
+
default:
ND_PRINT("[unknown special tag %u, size %u]",
tag, len);