install host route for p2p interface even if there's connected net route
by broadcast interface. PR 21903.
This commit is contained in:
parent
cf368599b3
commit
faef0b82e9
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: in.c,v 1.84 2003/06/15 02:49:32 matt Exp $ */
|
||||
/* $NetBSD: in.c,v 1.85 2003/06/18 06:42:34 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -102,7 +102,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.84 2003/06/15 02:49:32 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.85 2003/06/18 06:42:34 itojun Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet_conf.h"
|
||||
@ -920,21 +920,20 @@ in_addprefix(target, flags)
|
||||
|
||||
if ((flags & RTF_HOST) != 0)
|
||||
prefix = target->ia_dstaddr.sin_addr;
|
||||
else
|
||||
else {
|
||||
prefix = target->ia_addr.sin_addr;
|
||||
mask = target->ia_sockmask.sin_addr;
|
||||
prefix.s_addr &= mask.s_addr;
|
||||
mask = target->ia_sockmask.sin_addr;
|
||||
prefix.s_addr &= mask.s_addr;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
|
||||
/* easy one first */
|
||||
if (mask.s_addr != ia->ia_sockmask.sin_addr.s_addr)
|
||||
continue;
|
||||
|
||||
if (rtinitflags(ia))
|
||||
p = ia->ia_dstaddr.sin_addr;
|
||||
else
|
||||
else {
|
||||
p = ia->ia_addr.sin_addr;
|
||||
p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
|
||||
p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
|
||||
}
|
||||
|
||||
if (prefix.s_addr != p.s_addr)
|
||||
continue;
|
||||
|
||||
@ -973,21 +972,20 @@ in_scrubprefix(target)
|
||||
|
||||
if (rtinitflags(target))
|
||||
prefix = target->ia_dstaddr.sin_addr;
|
||||
else
|
||||
else {
|
||||
prefix = target->ia_addr.sin_addr;
|
||||
mask = target->ia_sockmask.sin_addr;
|
||||
prefix.s_addr &= mask.s_addr;
|
||||
mask = target->ia_sockmask.sin_addr;
|
||||
prefix.s_addr &= mask.s_addr;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
|
||||
/* easy one first */
|
||||
if (mask.s_addr != ia->ia_sockmask.sin_addr.s_addr)
|
||||
continue;
|
||||
|
||||
if (rtinitflags(ia))
|
||||
p = ia->ia_dstaddr.sin_addr;
|
||||
else
|
||||
else {
|
||||
p = ia->ia_addr.sin_addr;
|
||||
p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
|
||||
p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
|
||||
}
|
||||
|
||||
if (prefix.s_addr != p.s_addr)
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user