From 2aa11f677fcf14359b7c10f52007f68b121f022a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 18 Mar 1998 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1998-03-18 --- ip/ipifc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ip/ipifc.c b/ip/ipifc.c index db35fd8c4a8c4fa1a3994e132d910a6b3853be22..4fed051e7b3abc1c4332d6ee06e985bd2d5b8a0e 100644 --- a/ip/ipifc.c +++ b/ip/ipifc.c @@ -369,12 +369,23 @@ ipifcadd(Ipifc *ifc, char **argv, int argc) bcast[i] = (ip[i] & mask[i]) | ~mask[i]; addselfcache(f, ifc, lifc, bcast, Rbcast); + /* add old subnet directed broadcast addresses to the self cache */ + for(i = 0; i < IPaddrlen; i++) + bcast[i] = (ip[i] & mask[i]) & mask[i]; + addselfcache(f, ifc, lifc, bcast, Rbcast); + /* add network directed broadcast addresses to the self cache */ memmove(mask, defmask(ip), IPaddrlen); for(i = 0; i < IPaddrlen; i++) bcast[i] = (ip[i] & mask[i]) | ~mask[i]; addselfcache(f, ifc, lifc, bcast, Rbcast); + /* add old network directed broadcast addresses to the self cache */ + memmove(mask, defmask(ip), IPaddrlen); + for(i = 0; i < IPaddrlen; i++) + bcast[i] = (ip[i] & mask[i]) & mask[i]; + addselfcache(f, ifc, lifc, bcast, Rbcast); + addselfcache(f, ifc, lifc, IPv4bcast, Rbcast); out: