Skip to contentSkip to conversation

libxt_TCPOPTSTRIP: Use local copy of TCPOPTS constants

RFC PATCH Applied Felix Janda 2 participants 2 messages Jun 16, 2015 netfilter

lore
Share & tools
lore
#0 lore raw

RFC PATCH 4/4 libxt_TCPOPTSTRIP: Use local copy of TCPOPTS constants

musl does not provide these constants in <netinet/tcp.h>

---
It is not clear to me whether these constants belong to iptables or musl's netinet/tcp.h. So this message is CC'd to the musl list.

In the code indexed by debian code search I have only found iptables and traceroute using them without having a local copy of tcp.h.

Note that this patch is incomplete: utils/nfsynproxy.c uses them as well

---
 extensions/libxt_TCPOPTSTRIP.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
extensions/libxt_TCPOPTSTRIP.c +7 -4
index 6897857..1617081 100644
@@ -7,11 +7,14 @@
 #include <stdio.h>
 #include <string.h>
 #include <xtables.h>
-#include <netinet/tcp.h>
 #include <linux/netfilter/xt_TCPOPTSTRIP.h>
-#ifndef TCPOPT_MD5SIG
-#	define TCPOPT_MD5SIG 19
-#endif
+
+#define TCPOPT_MAXSEG 2
+#define TCPOPT_WINDOW 3
+#define TCPOPT_SACK_PERMITTED 4
+#define TCPOPT_SACK 5
+#define TCPOPT_TIMESTAMP 8
+#define TCPOPT_MD5SIG 19
 
 enum {
 	O_STRIP_OPTION = 0,
Signature · 1 line
2.3.6
#1 lore raw
Quoted 11 lines · Felix Janda

musl does not provide these constants in <netinet/tcp.h>

---
It is not clear to me whether these constants belong to iptables or musl's netinet/tcp.h. So this message is CC'd to the musl list.

In the code indexed by debian code search I have only found iptables and traceroute using them without having a local copy of tcp.h.

Note that this patch is incomplete: utils/nfsynproxy.c uses them as well

I'm not sure either. I'd like to hear from someone who has a good argument one way or the other.

Rich