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

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