netcat-openbsd: openbsd netcat with debian and other patches (#13565)

This commit is contained in:
Christof Meerwald
2026-01-02 11:07:28 +01:00
committed by GitHub
parent 78574333f5
commit 9bef77757b
2 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From 9b15294448d4aae4e5de0a855987fd42ef67b9fe Mon Sep 17 00:00:00 2001
From: Christof Meerwald <cmeerw@cmeerw.org>
Date: Mon, 22 Dec 2025 11:48:07 +0000
Subject: [PATCH] conditionally support IPTOS options
diff --git a/netcat-openbsd-19366e25d99290a6f3e76893a7196356ceed4cc2/netcat.c b/netcat-openbsd-19366e25d99290a6f3e76893a7196356ceed4cc2/netcat.c
index 8cc37f6..4df7d7f 100644
--- a/netcat-openbsd-19366e25d99290a6f3e76893a7196356ceed4cc2/netcat.c
+++ b/netcat-openbsd-19366e25d99290a6f3e76893a7196356ceed4cc2/netcat.c
@@ -1721,7 +1721,9 @@ process_tos_opt(char *s, int *val)
{ "af41", IPTOS_DSCP_AF41 },
{ "af42", IPTOS_DSCP_AF42 },
{ "af43", IPTOS_DSCP_AF43 },
+#ifdef IPTOS_PREC_CRITIC_ECP
{ "critical", IPTOS_PREC_CRITIC_ECP },
+#endif
{ "cs0", IPTOS_DSCP_CS0 },
{ "cs1", IPTOS_DSCP_CS1 },
{ "cs2", IPTOS_DSCP_CS2 },
@@ -1731,10 +1733,16 @@ process_tos_opt(char *s, int *val)
{ "cs6", IPTOS_DSCP_CS6 },
{ "cs7", IPTOS_DSCP_CS7 },
{ "ef", IPTOS_DSCP_EF },
+#ifdef IPTOS_PREC_INTERNETCONTROL
{ "inetcontrol", IPTOS_PREC_INTERNETCONTROL },
+#endif
+#ifdef IPTOS_LOWCOST
{ "lowcost", IPTOS_LOWCOST },
+#endif
{ "lowdelay", IPTOS_LOWDELAY },
+#ifdef IPTOS_PREC_NETCONTROL
{ "netcontrol", IPTOS_PREC_NETCONTROL },
+#endif
{ "reliability", IPTOS_RELIABILITY },
{ "throughput", IPTOS_THROUGHPUT },
{ NULL, -1 },
--
2.51.0