From owner-freebsd-bugs Sun Aug 19 1: 0:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7403037B40A for ; Sun, 19 Aug 2001 01:00:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7J808X32366; Sun, 19 Aug 2001 01:00:08 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9B43037B411 for ; Sun, 19 Aug 2001 00:53:02 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7J7r2J31957; Sun, 19 Aug 2001 00:53:02 -0700 (PDT) (envelope-from nobody) Message-Id: <200108190753.f7J7r2J31957@freefall.freebsd.org> Date: Sun, 19 Aug 2001 00:53:02 -0700 (PDT) From: Steve Whiteley To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/29867: 4.3 timed master can't sync Red Hat Linux 6.0 box Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 29867 >Category: misc >Synopsis: 4.3 timed master can't sync Red Hat Linux 6.0 box >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 19 01:00:08 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Steve Whiteley >Release: 4.3-stable >Organization: Whiteley Research Inc. >Environment: FreeBSD chaucer.srware.com 4.3-RC FreeBSD 4.3-RC #2: Sun Apr 22 14:16:02 PDT 2001 stevew@chaucer.srware.com:/usr3/obj/usr/src/sys/CHAUCER i386 >Description: Running timed as master, to synchronize a Red Hat Linux 6.0 box. This worked with FBSD3.5, after upgrading to 4.3, got console error "short packet (xx/xx bytes) from keats" (The real message included the byte counts.) There appeared to be no clock sync. >How-To-Repeat: boot and run >Fix: The problem is that the sizeof(struct tsp) differs on the two systems. Made the following change in readmsg.c near line 215, which seems to have fixed the problem. ---------------------------------------------------------------------- length = sizeof(from); if ((n = recvfrom(sock, (char *)&msgin, sizeof(struct tsp), 0, (struct sockaddr*)&from, &length)) < 0) { syslog(LOG_ERR, "recvfrom: %m"); exit(1); } /* SRW */ /* Here is a bug: the sizeof(struct tsp) is OS dependent, depending on the * length of the tsp_name field (MAXHOSTNAMELEN) which is, e.g., 256 for * FreeBSD 4.3 and 64 for RH Linux 6.0. Keep this as a sanity check, * but assume that the name field is 64 or larger */ if (n < (ssize_t)sizeof(struct tsp) - MAXHOSTNAMELEN + 64) { /* if (n < (ssize_t)sizeof(struct tsp)) { */ syslog(LOG_NOTICE, "short packet (%u/%u bytes) from %s", n, sizeof(struct tsp), inet_ntoa(from.sin_addr)); continue; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message