From avl@flox.kiam1.rssi.ru  Mon Mar 20 10:12:20 1995
Received: from flox.kiam1.rssi.ru (flox.kiam1.rssi.ru [193.232.3.40]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA01616 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 20 Mar 1995 10:12:08 -0800
Received: (from avl@localhost) by flox.kiam1.rssi.ru (8.6.9/8.6.9) id VAA01545; Mon, 20 Mar 1995 21:05:28 +0300
Message-Id: <199503201805.VAA01545@flox.kiam1.rssi.ru>
Date: Mon, 20 Mar 1995 21:05:28 +0300
From: Lapinsky Alexander <avl@flox.kiam1.rssi.ru>
Reply-To: avl@lotos.kiam1.rssi.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: timed & timedc bugs
X-Send-Pr-Version: 3.2

>Number:         544
>Category:       bin
>Synopsis:       timed & timedc bugs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 23 07:34:19 1995
>Closed-Date:    Fri Jun 23 10:38:21 PDT 1995
>Last-Modified:
>Originator:     Lapinsky Alexander
>Release:        FreeBSD 2.0-RELEASE i386
>Organization:
Moscow, Russia
>Environment:

	

>Description:

	time daemon -- timed:
	Message displayed:
	"bind: Can't assign requested address"

	and very big time difference displayed
	by
		timedc clockdiff lotos

>How-To-Repeat:

	I can fix it. I guess, it will be better.

>Fix:
	directory:	usr/src/usr.sbin/timed/timed
	files to patch:	measure.c timed.c
	rebuild:	timed timedc

-------------------------------- Cut here ----------------------------
*** measure.c.orig	Mon Mar 20 16:46:47 1995
--- measure.c	Mon Mar 20 20:07:49 1995
***************
*** 151,157 ****
  		 */
  		if (trials < TRIALS) {
  			trials++;
! 			oicp->icmp_otime = ((tcur.tv_sec % SECDAY) * 1000
  					    + tcur.tv_usec / 1000);
  			oicp->icmp_cksum = 0;
  			oicp->icmp_cksum = in_cksum((u_short*)oicp,
--- 151,157 ----
  		 */
  		if (trials < TRIALS) {
  			trials++;
! 			oicp->icmp_otime = htonl((tcur.tv_sec % SECDAY) * 1000
  					    + tcur.tv_usec / 1000);
  			oicp->icmp_cksum = 0;
  			oicp->icmp_cksum = in_cksum((u_short*)oicp,

*** timed.c.orig	Fri Jan  7 18:25:16 1994
--- timed.c	Fri Jan  7 18:27:00 1994
***************
*** 312,317 ****
--- 312,318 ----
  		exit(1);
  	}
  	port = srvp->s_port;
+ 	bzero(&server,sizeof(struct sockaddr_in));
  	server.sin_port = srvp->s_port;
  	server.sin_family = AF_INET;
  	sock = socket(AF_INET, SOCK_DGRAM, 0);
-------------------------- End of message ----------------------------
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: rgrimes 
State-Changed-When: Fri Jun 23 10:38:21 PDT 1995 
State-Changed-Why:  
Already fixed: 
RCS file: /home/ncvs/src/usr.sbin/timed/timed/measure.c,v 
---------------------------- 
revision 1.2 
date: 1994/11/27 16:06:31;  author: bde;  state: Exp;  lines: +3 -3 
Apply an even number of ntohl's to icmp_otime.  This fixes 
`timedc clockdiff ...'. 
---------------------------- 

RCS file: /home/ncvs/src/usr.sbin/timed/timed/timed.c,v 
---------------------------- 
revision 1.2 
date: 1995/05/15 09:56:49;  author: davidg;  state: Exp;  lines: +2 -1 
Fully initialize (bzero) the stack-allocated "struct sockaddr_in server" 
structure. Random junk on the stack would cause the call to bind to fail 
in some cases (since the address portion wasn't initialized). 
---------------------------- 

>Unformatted:



