From 4254ad64cc7d05b6d8a4a531234a2958a6bd0b77 Mon Sep 17 00:00:00 2001 From: bad Date: Thu, 27 May 1999 17:12:22 +0000 Subject: [PATCH] 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 . Also do the interface copying iff INT_LOOPBACK as in the BSDI version of this code. --- usr.sbin/xntp/xntpd/ntp_io.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.sbin/xntp/xntpd/ntp_io.c b/usr.sbin/xntp/xntpd/ntp_io.c index a4387ebc4176..4228708395b4 100644 --- a/usr.sbin/xntp/xntpd/ntp_io.c +++ b/usr.sbin/xntp/xntpd/ntp_io.c @@ -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 @@ create_sockets(port) * 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)