Subject: pkg/26164: Address binding bug in innd
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <bsd@allegory.demon.co.uk>
List: pkgsrc-bugs
Date: 07/05/2004 12:07:34
>Number:         26164
>Category:       pkg
>Synopsis:       Address binding bug in innd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 05 11:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Bob
>Release:        NetBSD 2.0F
>Organization:
	
>Environment:
	
	
System: NetBSD tenebres.loc 2.0F NetBSD 2.0F (TENEBRES) #0: Tue Jun 29 15:24:47 BST 2004 rob@tenebres.loc:/usr/src/sys/arch/i386/compile/TENEBRES i386
Architecture: i386
Machine: i386
>Description:

    A bug in INN 2.4.1 prevents it from binding to a specified address.
    Normally one should be able to use the "bindaddress" option in /var/news/etc/inn.conf
    but its value is not used.  The code will report an error if the argument of "bindaddress"
    is not a dotted quad but will not use it because the C code does not set "addr_specified" to true.

    I'm submitting this bug report so you can include it in a pkgsrc patch, if appropriate.
    I will also send a copy to inn-bugs@isc.org

>How-To-Repeat:

    In /var/news/etc/inn.conf, set "bindaddress" to 127.0.0.1, ie include the line
	bindaddress:	127.0.0.1
    Restart innd and type "netstat -anf inet" which will show

	Active Internet connections (including servers)
	Proto Recv-Q Send-Q  Local Address          Foreign Address        State
	tcp        0      0  *.119                  *.*                    LISTEN

    whereas it should instead be

	Active Internet connections (including servers)
	Proto Recv-Q Send-Q  Local Address          Foreign Address        State
	tcp        0      0  127.0.0.1.119          *.*                    LISTEN

>Fix:

    Two possibilities:

	Quick Hack:
	    Add
		innflags:              "-I 127.0.0.1"
	    (or equiv) to inn.conf

	Correct solution:
	    Set "addr_specified" flag to make inndstart use the given address.

	    *** /usr/pkgsrc/news/inn/work/inn-2.4.1/innd/inndstart.c	Wed Jan  7 22:47:19 2004
	    --- /tmp/inndstart.c	Mon Jul  5 03:02:15 2004
	    ***************
	    *** 136,141 ****
	    --- 136,142 ----
		  if (p && strcmp(p, "all") != 0 && strcmp(p, "any") != 0) {
		      if (!inet_aton(p, &address))
			  die("invalid bindaddress in inn.conf (%s)", p);
	    +         addr_specified = true;
		  }
	      #ifdef HAVE_INET6
		  address6 = in6addr_any;


>Release-Note:
>Audit-Trail:
>Unformatted: