summaryrefslogtreecommitdiff
path: root/debian/patches/62_inetd_change_ipv6_protocol_semantics.patch
blob: 4563995987aecd4b0b4a91a5b1997c949fbb5fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/src/inetd.c
+++ b/src/inetd.c
@@ -1048,9 +1048,9 @@ getconfigent (FILE *fconfig, const char
       sep->se_proto = newstr (argv[INETD_PROTOCOL]);
 
 #ifdef IPV6
-      /* We default to IPv4. */
+      /* We default to IPv4.  */
       sep->se_family = AF_INET;
-      sep->se_v4mapped = 1;
+      sep->se_v4mapped = 0;
 
       if ((strncmp (sep->se_proto, "tcp", 3) == 0)
 	  || (strncmp (sep->se_proto, "udp", 3) == 0))
@@ -1058,10 +1058,11 @@ getconfigent (FILE *fconfig, const char
 	  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')
 	    {