~ubuntu-branches/ubuntu/natty/openbsd-inetd/natty

« back to all changes in this revision

Viewing changes to debian/patches/tcp46

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2008-12-15 02:00:52 UTC
  • mfrom: (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081215020052-gwpkva043fq6nb1s
Tags: 0.20080125-2
* Added dh_md5sums to debian/rules, since apparently people nowadays
  believe again that it is a good idea. (Closes: #484483)
* Fixed the init script to povide "openbsd-inetd" instead of "inetd".
  (Closes: #507119)
* Updated patches misc_portability and setproctitle with some missing
  prototypes.
* Updated patch misc_portability with missing arguments to two syslog(3)
  calls.
* Updated patch libwrap to fix a possibly uninitialized variable.
  The last three fixes are courtesy of Denis Zaitsev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/inetd.8
 
2
+++ b/inetd.8
 
3
@@ -413,6 +413,11 @@ and IPv6 traffic will go to server on
 
4
 If you have only one server on
 
5
 .Dq tcp6 ,
 
6
 only IPv6 traffic will be routed to the server.
 
7
+.Pp
 
8
+The special
 
9
+.Dq tcp46
 
10
+parameter can be used for obsolete servers which require to receive IPv4
 
11
+connections mapped in an IPv6 socket. Its usage is discouraged.
 
12
 .El
 
13
 .Sh SEE ALSO
 
14
 .Xr fingerd 8 ,
 
15
--- a/inetd.c
 
16
+++ b/inetd.c
 
17
@@ -826,10 +826,14 @@ doconfig(void)
 
18
 
 
19
                                if (!port) {
 
20
                                        /* XXX */
 
21
+                                       char *p;
 
22
                                        strncpy(protoname, sep->se_proto,
 
23
                                                sizeof(protoname));
 
24
-                                       if (isdigit(protoname[strlen(protoname) - 1]))
 
25
-                                               protoname[strlen(protoname) - 1] = '\0';
 
26
+                                       for (p = protoname; *p; p++)
 
27
+                                               if (isdigit(*p)) {
 
28
+                                                       *p = '\0';
 
29
+                                                       break;
 
30
+                                               }
 
31
                                        sp = getservbyname(sep->se_service,
 
32
                                            protoname);
 
33
                                        if (sp == 0) {
 
34
@@ -1023,6 +1027,16 @@ setup(struct servtab *sep)
 
35
                    sep->se_service, sep->se_proto);
 
36
                return;
 
37
        }
 
38
+       if (strncmp(sep->se_proto, "tcp6", 4) == 0) {
 
39
+               if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_V6ONLY, &on,
 
40
+                           sizeof (on)) < 0)
 
41
+                       syslog(LOG_ERR, "setsockopt (IPV6_V6ONLY): %m");
 
42
+       } else if (strncmp(sep->se_proto, "tcp46", 5) == 0) {
 
43
+               int off = 0;
 
44
+               if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_V6ONLY, &off,
 
45
+                           sizeof (off)) < 0)
 
46
+                       syslog(LOG_ERR, "setsockopt (IPV6_V6ONLY): %m");
 
47
+       }
 
48
 #define        turnon(fd, opt) \
 
49
 setsockopt(fd, SOL_SOCKET, opt, &on, sizeof (on))
 
50
        if (strncmp(sep->se_proto, "tcp", 3) == 0 && (options & SO_DEBUG) &&