📄 9
字号:
From: Jeremy Cooper <j@broder.com>Subject: Possible bug with BSD/OS 2.1 and 3.5fNewsgroups: comp.protocols.time.ntpDate: Fri, 28 Jun 1996 12:27:37 -0700Organization: Broderbund SoftwarePath: fred.net!news2.cais.net!news.cais.net!nntp.primenet.com!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!news.broder.com!usenet-controlLines: 40Distribution: inetMessage-ID: <31D43229.41C67EA6@broder.com>NNTP-Posting-Host: crayola.broder.comMime-Version: 1.0Content-Type: text/plain; charset=us-asciiContent-Transfer-Encoding: 7bitX-Mailer: Mozilla 2.0 (X11; I; BSD/OS 2.0 i386)I have found what I believe is a possible bug and a patch for itin the xntpd code.Description:------------During startup, xntpd determines the addresses of all the interfaceson the system. In BSD/OS version 2.1 the daemon receives a protectionviolation signal while attempting to do this on some systems.In xntpd/ntp_io.c the new system call, 'getifaddrs', is used toobtain information about all of the system network interfaces.The description of this function states that some interfaces mayreturn a NULL pointer in the 'ifa_addr' member of the interfacestructure if no definite address for that interface exists.ntp_io.c does not check for this.Symptom:--------xntpd core dumps on startup.Fix:----Have the code check to make sure that the 'ifa_addr' member is not NULLbefore attempting to determine its address family ('ifa_addr->sa_family').If it is NULL, skip the interface and move to the next one.In diff -c format the patch is:*** ntp_io.c Fri Jun 28 12:17:41 1996--- ntp_io.c.new Fri Jun 28 12:17:46 1996****************** 314,319 ****--- 314,321 ---- for (ifap = ifaddrs, lp = ifap + num_if; ifap < lp; ifap++) { struct sockaddr_in *sin; + if (!ifap->ifa_addr)+ continue; if (ifap->ifa_addr->sa_family != AF_INET) continue;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -