home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / protocol / time / ntp / 1125 < prev    next >
Encoding:
Text File  |  1992-12-31  |  3.6 KB  |  93 lines

  1. Xref: sparky comp.protocols.time.ntp:1125 comp.unix.aix:12771
  2. Newsgroups: comp.protocols.time.ntp,comp.unix.aix
  3. Path: sparky!uunet!think.com!rpi!batcomputer!ghost.dsi.unimi.it!ipgaix!peppe
  4. From: peppe@ipgaix.unipg.it (G. Vitillaro)
  5. Subject: xntp3 under AIX/370 1.2.1 (Update Level 1400)
  6. Message-ID: <1992Dec22.120501.165429@ipgaix.unipg.it>
  7. Summary: xntp3 hangs under AIX/370 1.2.1
  8. Keywords: xntp3, AIX/370, hang
  9. Organization: Universita' di Perugia
  10. Date: Tue, 22 Dec 1992 12:05:01 GMT
  11. Lines: 80
  12.  
  13. Sorry to invade this groups again on a problem that maybe is
  14. very particular, but I would really need some help from someone
  15. more skilled than me on xntp.
  16.  
  17. I did some little debugging on xntpd. The problem is that xntpd
  18. seems to hang (no answer to ntqp or xntpdc queries).
  19.  
  20. Well the xntpd was not really hanging: was just dropping all
  21. the packet coming to him.
  22.  
  23. The core of the problem seems to be in <ntp_io.c>.
  24.  
  25. The source define a "wildcard" interface defined that way:
  26.  
  27.         /*
  28.          * create pseudo-interface with wildcard address
  29.          */
  30.         inter_list[0].sin.sin_family = AF_INET;
  31.         inter_list[0].sin.sin_port = port;
  32.         inter_list[0].sin.sin_addr.s_addr = INADDR_ANY;
  33.         (void) strncpy(inter_list[0].name, "wildcard",
  34.              sizeof(inter_list[0].name));
  35.         inter_list[0].mask.sin_addr.s_addr = htonl(~0);
  36.         inter_list[0].received = 0;
  37.         inter_list[0].sent = 0;
  38.         inter_list[0].notsent = 0;
  39.         inter_list[0].flags = INT_BROADCAST;
  40.  
  41. This interface (quoted also as any_interface in some subroutine) is
  42. used I think to send packets to a non local network. The problem is
  43. that one time that a just one packet is sent to this interface (that
  44. have address 0.0.0.0) all the packet come from this interface.
  45. But in ntp_io.c (function input_handler) this piece of code:
  46.  
  47.                                 if (i == 0 || free_recvbufs == 0) {
  48.                                         char buf[RX_BUFF_SIZE];
  49.  
  50.                                         (void) read(fd, buf, sizeof buf);
  51.                                         if (i == 0)
  52.                                                 packets_ignored++;
  53.                                         else
  54.                                                 packets_dropped++;
  55.                                         continue;
  56.                                 }
  57.  
  58. will drop all the packet coming from the interface 0 [note if (i==0] that
  59. is just the wildcard interface.
  60.  
  61. If I change the line:
  62.                                 if (i == 0 || free_recvbufs == 0) {
  63. to
  64.                                 if (free_recvbufs == 0) {
  65.  
  66. in the above code the xntpd start to work (apparently correctly), although
  67. the <peers> command in xntpdc report 0.0.0.0 for local (I don't know
  68. if this is correct).
  69.  
  70. Just to finish, if (using the original code) I don't list any peer
  71. the xntpd answer to the local query, I think because no packets was
  72. sent to the interfcae with INADDR_ANY [0.0.0.0] address.
  73.  
  74. Well (sorry to have bothered the group at this point) my question are:
  75.  
  76. 1) Any idea why all the packet are coming from the wildcard interface?
  77.  
  78. 2) The code I hacked may work without problems?
  79.  
  80. 3) Better ideas in the way to hack this code?
  81.  
  82. I learned a lot about the use of signals and ASYNC IO (that is supported
  83. by AIX/370 at the end) under UNIX debugging xntpd: my compliment to the
  84. authors, it is a wonderful peace of code.
  85.  
  86. Best Regards   Peppe
  87.  
  88. -- 
  89. Giuseppe Vitillaro - IBM SEMEA      |  E-Mail : peppe@ipgaix.unipg.it 
  90. University of Perugia Italy         |  06100 Perugia  Phone:+39.75.585-2200
  91. ---------------------------------------------------------------------------
  92. All comments/opinions are mine and don't represent those of IBM
  93.