NetBSD Problem Report #39

From gnats  Fri Dec 10 09:58:16 1993
Received: from gandalf.bbb.no (gandalf.bbb.no [192.124.156.194]) by sun-lamp.cs.berkeley.edu (8.6.4/8.6.4) with ESMTP id JAA19271 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 10 Dec 1993 09:57:49 -0800
Message-Id: <199312101757.SAA06342@gandalf.bbb.no>
Date: Fri, 10 Dec 1993 18:57:27 +0100
From: tholo@SigmaSoft.COM
Reply-To: tholo@SigmaSoft.COM
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: xntp doesn't properly bind interfaces
X-Send-Pr-Version: 3.01.6

>Number:         39
>Category:       bin
>Synopsis:       xntp tries to locate all interfaces, but structure changed
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 10 10:05:02 +0000 1993
>Closed-Date:    Thu Feb 24 01:06:52 +0000 1994
>Last-Modified:  Sun Mar 03 17:52:58 +0000 2013
>Originator:     Thorsten Lockert
>Release:        NetBSD-current
>Organization:
Thorsten Lockert  | postmaster@bbb.no   |
Postbox 435       | hostmaster@bbb.no   |  Universe, n.:
N-5001 Bergen     | tholo@bbb.no        |          The problem.
Norway            | tholo@sigmasoft.com |
>Environment:
System: NetBSD gandalf.bbb.no 0.9a GANDALF#8 i386
>Description:
xntp uses old code to get a list of all interfaces on the system in order
to bind each one seperately.  This is fixed in newer versions of xntp,
but I've put in a patch that duplicates the behavious of newer versions
>How-To-Repeat:
If you look at the output from 'netstat -a', you will find that it has
only bound the wildcard port '*.ntp', and not interface-specific ports.
The code also ignores any packets received on the wildcard port, and thus
refuse to operate.

After the fix has been installed, it will properly bind the interface
specific ports as well.
>Fix:
*** ntp_io.c.orig	Sun Nov  7 12:40:20 1993
--- ntp_io.c	Tue Dec  7 10:13:40 1993
***************
*** 191,197 ****
  	char	buf[1024];
  	struct	ifconf	ifc;
  	struct	ifreq	ifreq, *ifr;
! 	int n, i, j, vs;
  	struct sockaddr_in resmask;
  	int open_socket();
  	extern void restrict();
--- 191,197 ----
  	char	buf[1024];
  	struct	ifconf	ifc;
  	struct	ifreq	ifreq, *ifr;
! 	int size, n, i, j, vs;
  	struct sockaddr_in resmask;
  	int open_socket();
  	extern void restrict();
***************
*** 221,230 ****
  		syslog(LOG_ERR, "get interface configuration: %m");
  		exit(1);
  	}
! 	n = ifc.ifc_len/sizeof(struct ifreq);

  	i = 1;
! 	for (ifr = ifc.ifc_req; n > 0; n--, ifr++) {
  		if (ifr->ifr_addr.sa_family != AF_INET)
  			continue;
  		ifreq = *ifr;
--- 221,239 ----
  		syslog(LOG_ERR, "get interface configuration: %m");
  		exit(1);
  	}
! 	n = ifc.ifc_len;

  	i = 1;
! 	for (ifr = ifc.ifc_req; n > 0;
! 	     ifr = (struct ifreq *)((char *)ifr + size)) {
! 		size = sizeof(*ifr);
! #if defined(BSD) && !defined(sun)
! #if BSD >= 199006
! 		if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_addr))
! 			size += ifr->ifr_addr.sa_len - sizeof(struct sockaddr);
! #endif
! #endif
! 		n -= size;
  		if (ifr->ifr_addr.sa_family != AF_INET)
  			continue;
  		ifreq = *ifr;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Wed Feb 23 17:06:52 PST 1994 
State-Changed-Why:  
xntp gone from othersrc.  out-of-the-box version in louie.udel.edu:/pub/ntp 
works for NetBSD. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.