patch from Yuval Yarom, sent to me by <andrew@werple.apana.org.au>

The check that the destination of a forwarded ip packet is not on
the loopback net is wrong, and will always fail.  The following patch
fixes the problem.
[allows "route add $hostname localhost" to be added to /etc/netstart to
keep things for $hostname away from the ethernet driver]
This commit is contained in:
deraadt 1993-06-10 05:16:46 +00:00
parent f37ee25bb2
commit 6fe3b028cd
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)in.c 7.17 (Berkeley) 4/20/91
* $Id: in.c,v 1.3 1993/05/22 11:42:29 cgd Exp $
* $Id: in.c,v 1.4 1993/06/10 05:16:46 deraadt Exp $
*/
#include "param.h"
@ -226,7 +226,7 @@ in_canforward(in)
return (0);
if (IN_CLASSA(i)) {
net = i & IN_CLASSA_NET;
if (net == 0 || net == IN_LOOPBACKNET)
if (net == 0 || net == (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))
return (0);
}
return (1);