INN commit: trunk (4 files)

INN Commit Russ_Allbery at isc.org
Sun May 17 13:12:17 UTC 2009


    Date: Sunday, May 17, 2009 @ 06:12:15
  Author: iulius
Revision: 8474

Add a -4 flag to both innd and nnrpd for IPv4 binding addresses,
similarly to -6 for IPv6.

Modified:
  trunk/doc/pod/innd.pod
  trunk/doc/pod/nnrpd.pod
  trunk/innd/innd.c
  trunk/nnrpd/nnrpd.c

-------------------+
 doc/pod/innd.pod  |   32 ++++++++++++++++----------------
 doc/pod/nnrpd.pod |   18 +++++++++++-------
 innd/innd.c       |   11 ++++++-----
 nnrpd/nnrpd.c     |   13 ++++++++-----
 4 files changed, 41 insertions(+), 33 deletions(-)

Modified: doc/pod/innd.pod
===================================================================
--- doc/pod/innd.pod	2009-05-17 10:19:39 UTC (rev 8473)
+++ doc/pod/innd.pod	2009-05-17 13:12:15 UTC (rev 8474)
@@ -4,9 +4,9 @@
 
 =head1 SYNOPSIS
 
-B<innd> [B<-aCdfNrsu>] [B<-6> I<address>] [B<-c> I<days>] [B<-H> I<count>]
-[B<-i> I<count>] S<[B<-I> I<address>]> [B<-l> I<size>] [B<-m> I<mode>]
-[B<-n> I<flag>] [B<-o> I<count>] [B<-P> I<port>] S<[B<-t> I<timeout>]>
+B<innd> [B<-aCdfNrsu>] [B<-4> I<address>] [B<-6> I<address>] [B<-c> I<days>]
+[B<-H> I<count>] [B<-i> I<count>] [B<-l> I<size>] [B<-m> I<mode>]
+[B<-n> I<flag>] [B<-o> I<count>] [B<-P> I<port>] [B<-t> I<timeout>]
 [B<-T> I<count>] [B<-X> I<seconds>]
 
 =head1 DESCRIPTION
@@ -65,6 +65,18 @@
 
 =over 4
 
+=item B<-4> I<address>
+
+Normally B<innd> binds to all local IP addresses (unless I<bindaddress> is
+set in F<inn.conf>).  If this option is given, it specifies the IP address
+that INN should bind as.  This is only relevant for servers with multiple
+local IP addresses.  The IP address must be in dotted-quad
+(C<nnn.nnn.nnn.nnn>) format.
+
+If this option is specified, it's the same as setting I<bindaddress> in
+F<inn.conf> and may cause changes in whether INN binds to an IPv6 address
+as well.  See inn.conf(5) for more details and also the B<-6> flag for B<innd>.
+
 =item B<-6> I<address>
 
 Only applies when INN has been built with IPv6 support.  Normally B<innd>
@@ -75,7 +87,7 @@
 
 If this option is specified, it's the same as setting I<bindaddress6> in
 F<inn.conf> and may cause changes in whether INN binds to an IPv4 address
-as well.  See inn.conf(5) for more details and also the B<-I> flag for B<innd>.
+as well.  See inn.conf(5) for more details and also the B<-4> flag for B<innd>.
 
 =item B<-a>
 
@@ -136,18 +148,6 @@
 given, overrides the value of that setting.  If I<count> is C<0>, this
 check is suppressed.
 
-=item B<-I> I<address>
-
-Normally B<innd> binds to all local IP addresses (unless I<bindaddress> is
-set in F<inn.conf>).  If this option is given, it specifies the IP address
-that INN should bind as.  This is only relevant for servers with multiple
-local IP addresses.  The IP address must be in dotted-quad
-(C<nnn.nnn.nnn.nnn>) format.
-
-If this option is specified, it's the same as setting I<bindaddress> in
-F<inn.conf> and may cause changes in whether INN binds to an IPv6 address
-as well.  See inn.conf(5) for more details and also the B<-6> flag for B<innd>.
-
 =item B<-l> I<size>
 
 B<innd> normally rejects any article larger than the value of

Modified: doc/pod/nnrpd.pod
===================================================================
--- doc/pod/nnrpd.pod	2009-05-17 10:19:39 UTC (rev 8473)
+++ doc/pod/nnrpd.pod	2009-05-17 13:12:15 UTC (rev 8474)
@@ -4,8 +4,8 @@
 
 =head1 SYNOPSIS
 
-B<nnrpd> [B<-DfnoSt>] [B<-6> I<address>] [B<-b> I<address>]
-[B<-c> I<configfile>] S<[B<-i> I<initial>]> [B<-I> I<instance>]
+B<nnrpd> [B<-DfnoSt>] [B<-4> I<address>] [B<-6> I<address>] [B<-b> I<address>]
+[B<-c> I<configfile>] [B<-i> I<initial>] [B<-I> I<instance>]
 [B<-p> I<port>] [B<-P> I<prefork>] [B<-r> I<reason>] [B<-s> I<padding>]
 
 =head1 DESCRIPTION
@@ -45,6 +45,14 @@
 
 =over 4
 
+=item B<-4> I<address>
+
+The B<-4> parameter instructs B<nnrpd> to bind to the specified IPv4
+address when started as a standalone daemon using the B<-D> flag.  This
+has to be a valid IPv4 address belonging to an interface of the local
+host.  It can also be C<0.0.0.0>, saying to bind to all addresses (this
+is the default).
+
 =item B<-6> I<address>
 
 The B<-6> parameter instructs B<nnrpd> to bind to the specified IPv6
@@ -59,11 +67,7 @@
 
 =item B<-b> I<address>
 
-The B<-b> parameter instructs B<nnrpd> to bind to the specified IPv4
-address when started as a standalone daemon using the B<-D> flag.  This
-has to be a valid IPv4 address belonging to an interface of the local
-host.  It can also be C<0.0.0.0>, saying to bind to all addresses (this
-is the default).
+Similar to the B<-4> flag.  B<-b> is kept for backwards compatibility.
 
 =item B<-c> I<configfile>
 

Modified: innd/innd.c
===================================================================
--- innd/innd.c	2009-05-17 10:19:39 UTC (rev 8473)
+++ innd/innd.c	2009-05-17 13:12:15 UTC (rev 8474)
@@ -403,11 +403,16 @@
 
     /* Parse JCL. */
     CCcopyargv(av);
-    while ((i = getopt(ac, av, "6:ac:Cdfi:l:m:o:Nn:P:rst:uH:T:X:")) != EOF)
+    while ((i = getopt(ac, av, "4:6:ac:CdfH:i:l:m:n:No:P:rst:T:uX:")) != EOF)
 	switch (i) {
 	default:
 	    Usage();
 	    /* NOTREACHED */
+        case '4':
+            if (innconf->bindaddress)
+                free(innconf->bindaddress);
+            innconf->bindaddress = xstrdup(optarg);
+            break;
         case '6':
             if (innconf->bindaddress6)
                 free(innconf->bindaddress6);
@@ -434,10 +439,6 @@
 	case 'i':
 	    innconf->maxconnections = atoi(optarg);
 	    break;
-	case 'I':
-	    if (innconf->bindaddress) free(innconf->bindaddress);
-	    innconf->bindaddress = xstrdup(optarg);
-	    break;
 	case 'l':
 	    innconf->maxartsize = atol(optarg);
 	    break;

Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c	2009-05-17 10:19:39 UTC (rev 8473)
+++ nnrpd/nnrpd.c	2009-05-17 13:12:15 UTC (rev 8474)
@@ -906,20 +906,23 @@
 #endif /* HAVE_SASL */
 
 #ifdef HAVE_SSL
-    while ((i = getopt(argc, argv, "6:c:b:Dfi:I:nop:P:r:s:tS")) != EOF)
+    while ((i = getopt(argc, argv, "4:6:b:c:Dfi:I:nop:P:r:s:St")) != EOF)
 #else
-    while ((i = getopt(argc, argv, "6:c:b:Dfi:I:nop:P:r:s:t")) != EOF)
+    while ((i = getopt(argc, argv, "4:6:b:c:Dfi:I:nop:P:r:s:t")) != EOF)
 #endif /* HAVE_SSL */
 	switch (i) {
 	default:
 	    Usage();
 	    /* NOTREACHED */
+        case '4':                       /* Bind to a certain IPv4 address. */
+        case 'b':
+            if (ListenAddr != NULL)
+                die("-b and -4 may not both be given");
+            ListenAddr = xstrdup(optarg);
+            break;
         case '6':                       /* Bind to a certain IPv6 address. */
             ListenAddr6 = xstrdup(optarg);
             break;
- 	case 'b':			/* Bind to a certain IPv4 address. */
-            ListenAddr = xstrdup(optarg);
- 	    break;
 	case 'c':                       /* Use alternate readers.conf. */
 	    ConfFile = concatpath(innconf->pathetc, optarg);
 	    break;




More information about the inn-committers mailing list