From owner-freebsd-net Fri Oct 25 12: 0:30 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A62A337B401 for ; Fri, 25 Oct 2002 12:00:28 -0700 (PDT) Received: from kzsu.stanford.edu (KZSU.Stanford.EDU [171.66.118.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53F0C43E65 for ; Fri, 25 Oct 2002 12:00:28 -0700 (PDT) (envelope-from romain@kzsu.stanford.edu) Received: from kzsu.stanford.edu (localhost [127.0.0.1]) by kzsu.stanford.edu (8.12.3/8.12.3) with ESMTP id g9PJ0Rdj045546 for ; Fri, 25 Oct 2002 12:00:27 -0700 (PDT) (envelope-from romain@kzsu.stanford.edu) Received: (from romain@localhost) by kzsu.stanford.edu (8.12.3/8.12.3/Submit) id g9PJ0RPo045545 for freebsd-net@FreeBSD.ORG; Fri, 25 Oct 2002 12:00:27 -0700 (PDT) Date: Fri, 25 Oct 2002 12:00:27 -0700 From: Romain Kang To: freebsd-net@FreeBSD.ORG Subject: post-ifconfig delay causes ntpdate failure? Message-ID: <20021025190027.GA45509@kzsu.stanford.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Scanned-By: MIMEDefang 2.15 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I spent some time trying to figure out why the my ntpdate doesn't seem to work. It appears to me that the fxp0 isn't transmitting for a relatively long period of time following the ifconfig. The saga follows. On the client (10.10.1.101), I gave ntpdate the -d flag and saved its output. ntpdate claimed that the server (10.10.1.100) never replied to its ntp queries. I stuck a tcpdump into rc.network, then ran a ping loop to see how long it took before the first ping to the server succeeded. The shell code claimed 25 seconds: (T0=`date +%s` I=0 MAX=30 echo "rc.network: first ping test" while ! { ping -q -c1 10.10.1.100 > /dev/null; } do I=`expr $I + 1` test $I -ge $MAX && break sleep 1 done T1=`date +%s` DIFF=`expr $T1 - $T0` echo "$DIFF seconds to first successful ping") >> $LOG 2>&1 tcpdump on the client saw: 23:55:53.019046 arp who-has 10.10.1.100 (2e:2f:30:31:32:33) tell 10.10.1.101 23:56:05.219283 arp who-has 10.10.1.100 (2e:2f:30:31:32:33) tell 10.10.1.101 23:56:05.220140 arp reply 10.10.1.100 is-at 0:90:fb:8:71:fd 23:56:05.220172 10.10.1.101 > 10.10.1.100: icmp: echo request 23:56:05.221017 10.10.1.100 > 10.10.1.101: icmp: echo reply The server saw: 23:56:05.967915 arp who-has 10.10.1.100 (2e:2f:30:31:32:33) tell 10.10.1.101 23:56:05.967950 arp reply 10.10.1.100 is-at 0:90:fb:8:71:fd 23:56:05.969464 10.10.1.101 > 10.10.1.100: icmp: echo request 23:56:05.969513 10.10.1.100 > 10.10.1.101: icmp: echo reply With the ping loop inserted before ntpdate, the client was able to get its initial date set. This works, but it seems like a crude hack. Anyone have a better idea? -- Romain Kang Disclaimer: I speak for myself alone, romain@kzsu.stanford.edu except when indicated otherwise. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message