Subject: bin/5384: Xntpd serial port handling broken in -current
To: None <gnats-bugs@gnats.netbsd.org>
From: Tom Ivar Helbekkmo <tih@Hamartun.Priv.NO>
List: netbsd-bugs
Date: 05/01/1998 21:03:30
>Number:         5384
>Category:       bin
>Synopsis:       xntpd tries to ioctl(F_SETOWN) a non-ctty line
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May  1 12:35:00 1998
>Last-Modified:
>Originator:     Tom Ivar Helbekkmo
>Organization:
T&T
>Release:        1998-04-25
>Environment:
System: NetBSD barsoom.Hamartun.Priv.NO 1.3E NetBSD 1.3E (BARSOOM) #0: Tue Apr 28 08:36:12 CEST 1998 tih@barsoom.Hamartun.Priv.NO:/sys/arch/sparc/compile/BARSOOM sparc

>Description:

There's a problem with the F_SETOWN ioctl in the configuration of
xntpd that's in -current.  I've got a radio clock hooked up to one of
my serial ports, and I get this when xntpd starts:

May  1 18:26:54 barsoom xntpd[170]: 5.90 3-NetBSD Thu Apr 17 17:15:47 EDT 1997 (1)
May  1 18:26:54 barsoom xntpd[170]: tickadj = 40, tick = 10000, tvu_maxslew = 3960, est. hz = 100
May  1 18:26:54 barsoom xntpd[170]: precision = 29 usec
May  1 18:26:54 barsoom xntpd[170]: fcntl(F_SETOWN) fails for clock I/O: Inappropriate ioctl for device
May  1 18:26:55 barsoom xntpd[170]: PARSE receiver #1: parse_start: addclock /dev/refclock-1 fails (ABORT - clock type requires async io)
May  1 18:26:55 barsoom xntpd[170]: configuration of 127.127.8.1 failed

>How-To-Repeat:

Run xntpd on a system configured with a refclock on a serial port.

>Fix:

The problem is easily fixed -- it's right there in the xntp2netbsd
script, where we find:

/* must we have a CTTY for fsetown? */
/* #undef USE_FSETOWNCTTY */

This should be:

/* must we have a CTTY for fsetown? */
#define USE_FSETOWNCTTY

...since we don't allow an F_SETOWN ioctl on anything that isn't the
controlling terminal.
>Audit-Trail:
>Unformatted: