Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/xntp/xntpd Resurrect the code to check for duplicat...



details:   https://anonhg.NetBSD.org/src/rev/baf99a159f86
branches:  trunk
changeset: 473293:baf99a159f86
user:      bad <bad%NetBSD.org@localhost>
date:      Thu May 27 17:12:22 1999 +0000

description:
Resurrect the code to check for duplicate interface addresses that was
lost in the previous change.

This fixes PRs 7065 and 7482 by Martin Husemann <martin%rumolt.teuto.de@localhost>.

Also do the interface copying iff INT_LOOPBACK as in the BSDI version of
this code.

diffstat:

 usr.sbin/xntp/xntpd/ntp_io.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r bf91b75249a7 -r baf99a159f86 usr.sbin/xntp/xntpd/ntp_io.c
--- a/usr.sbin/xntp/xntpd/ntp_io.c      Thu May 27 16:04:48 1999 +0000
+++ b/usr.sbin/xntp/xntpd/ntp_io.c      Thu May 27 17:12:22 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_io.c,v 1.9 1999/01/29 13:19:17 bouyer Exp $        */
+/*     $NetBSD: ntp_io.c,v 1.10 1999/05/27 17:12:22 bad Exp $  */
 
 /*
  * xntp_io.c - input/output routines for xntpd.  The socket-opening code
@@ -607,11 +607,15 @@
        * for the two aliases on the one physical interface. -wsr
        */
       for (j=0; j < i; j++)
-       if ((inter_list[j].sin.sin_addr.s_addr &
+       if (((inter_list[j].sin.sin_addr.s_addr ==
+           inter_list[i].sin.sin_addr.s_addr) ||
+           ((inter_list[j].sin.sin_addr.s_addr &
            inter_list[j].mask.sin_addr.s_addr) ==
            (inter_list[i].sin.sin_addr.s_addr &
-           inter_list[i].mask.sin_addr.s_addr))
+           inter_list[i].mask.sin_addr.s_addr))))
          {
+           if (inter_list[j].flags & INT_LOOPBACK)
+             inter_list[j] = inter_list[i];
            break;
          }
       if (j == i)



Home | Main Index | Thread Index | Old Index