summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2010-09-08 04:38:01 +0200
committerGuillem Jover <guillem@hadrons.org>2010-09-12 16:29:14 +0200
commit8574eb9c113d651ccc58984561371230ec7606d2 (patch)
treef5f692ee2d1f8cd0d629c220993db9c8a766a26f
parenta9bb251258c44e60035a5918576b9f48e6a3b0a7 (diff)
downloadinetutils-8574eb9c113d651ccc58984561371230ec7606d2.tar.gz
Change inetd “tcp” and “udp” service protocol to IPv4 only
Change “tcp6” and “udp6” to accept IPv4 mapped addresses. And add “tcp6only” and “udp6only” for IPv6 only connections. Closes: #404760, #519316, #594422
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/62_inetd_change_ipv6_protocol_semantics.patch80
-rw-r--r--debian/patches/series1
3 files changed, 85 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 9c770b9..233ac0f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,10 @@ inetutils (2:1.8-1) UNRELEASED; urgency=low
* Do not segfault in inetd when a service does not have any argument.
(Closes: #515070, #590128)
* Make inetd listen on ports when enabling tcpmux services.
+ * Change inetd “tcp” and “udp” service protocol semantics to default them
+ to IPv4 only connections. Change “tcp6” and “udp6” to accept IPv4 mapped
+ addresses. And add “tcp6only” and “udp6only” for IPv6 only connections.
+ (Closes: #404760, #519316, #594422)
-- Guillem Jover <guillem@debian.org> Tue, 08 Jun 2010 21:16:04 +0200
diff --git a/debian/patches/62_inetd_change_ipv6_protocol_semantics.patch b/debian/patches/62_inetd_change_ipv6_protocol_semantics.patch
new file mode 100644
index 0000000..50ee383
--- /dev/null
+++ b/debian/patches/62_inetd_change_ipv6_protocol_semantics.patch
@@ -0,0 +1,80 @@
+From ee6ea58645a4db63f6ccad40566b37b23279797e Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Mon, 6 Sep 2010 10:52:27 +0200
+Subject: [PATCH 3/3] inetd: Change protocol semantics in inetd.conf
+
+* src/inetd.c (setup): Update comment.
+(getconfigent) [IPV6]: Change default family to IPv4 for "tcp" and
+"udp". Change "tcp6" and "udp6" to support IPv4 mapped addresses.
+Add "tcp6only" and "udp6only" protocols for IPv6 only addresses.
+(fix_tcpmux) [IPV6]: Set se_proto to "tcp6".
+[!IPV6]: Set se_proto to "tcp".
+---
+ src/inetd.c | 20 ++++++++++++--------
+ 1 files changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/src/inetd.c b/src/inetd.c
+index 1c51a51..0d3ff69 100644
+--- a/src/inetd.c
++++ b/src/inetd.c
+@@ -563,8 +563,8 @@ setup (struct servtab *sep)
+ if (sep->se_family == AF_INET6)
+ {
+ /* Reverse the value of SEP->se_v4mapped, since otherwise if
+- using `tcp' as a protocol type all connections will be mapped
+- to IPv6, and with `tcp6' they get mapped IPv4 mapped to
++ using `tcp6' as a protocol type all connections will be mapped
++ to IPv6, and with `tcp6only' they get mapped IPv4 mapped to
+ IPv6. */
+ int val = sep->se_v4mapped ? 0 : 1;
+ if (setsockopt (sep->se_fd, IPPROTO_IPV6, IPV6_V6ONLY,
+@@ -1002,10 +1002,9 @@ getconfigent (FILE *fconfig, const char *file, size_t *line)
+ sep->se_proto = newstr (argv[INETD_PROTOCOL]);
+
+ #ifdef IPV6
+- /* We default to IPv6, in setup() we'll fall back to IPv4 if
+- it doesn't work. */
+- sep->se_family = AF_INET6;
+- sep->se_v4mapped = 1;
++ /* We default to IPv4. */
++ sep->se_family = AF_INET;
++ sep->se_v4mapped = 0;
+
+ if ((strncmp (sep->se_proto, "tcp", 3) == 0)
+ || (strncmp (sep->se_proto, "udp", 3) == 0))
+@@ -1013,7 +1012,11 @@ getconfigent (FILE *fconfig, const char *file, size_t *line)
+ if (sep->se_proto[3] == '6')
+ {
+ sep->se_family = AF_INET6;
+- sep->se_v4mapped = 0;
++ /* Check for tcp6only and udp6only. */
++ if (strcmp (&sep->se_proto[3], "6only") == 0)
++ sep->se_v4mapped = 0;
++ else
++ sep->se_v4mapped = 1;
+ }
+ else if (sep->se_proto[3] == '4')
+ {
+@@ -1221,7 +1224,6 @@ fix_tcpmux (void)
+
+ serv.se_service = newstr ("tcpmux");
+ serv.se_socktype = SOCK_STREAM;
+- serv.se_proto = newstr ("tcp");
+ serv.se_checked = 1;
+ serv.se_user = newstr ("root");
+ serv.se_bi = bi_lookup (&serv);
+@@ -1239,9 +1241,11 @@ fix_tcpmux (void)
+ serv.se_fd = -1;
+ serv.se_type = NORM_TYPE;
+ #ifdef IPV6
++ serv.se_proto = newstr ("tcp6");
+ serv.se_family = AF_INET6;
+ serv.se_v4mapped = 1;
+ #else
++ serv.se_proto = newstr ("tcp");
+ serv.se_family = AF_INET;
+ #endif
+ if (debug)
+--
+1.7.1
+
diff --git a/debian/patches/series b/debian/patches/series
index aea1f5e..d1bd1a8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
54_man_fixes.patch
60_inetd_support_argless_services.patch
61_inetd_listen_on_tcpmux_ports.patch
+62_inetd_change_ipv6_protocol_semantics.patch