Date: Tue, 07 Jul 1998 09:42:55 -0700 From: David Greenman <dg@root.com> To: Samuel S Thomas <sthomas@lart.net> Cc: Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-bugs@FreeBSD.ORG Subject: Re: kern/7191: FreeBSD 2.2.6 generates Source-route prohibited when not routing Message-ID: <199807071642.JAA26863@implode.root.com>
index | next in thread | raw e-mail
I said:
> Don't bother. It doesn't work correctly. The code thinks that the packet
>is local and ends up generating a ICMP port-unreachable...which is quite
>bogus. I think I know what is wrong, but the fix is ugly.
Okay, a working fix is attached. Sorry about the last one.
-DG
David Greenman
Co-founder/Principal Architect, The FreeBSD Project
Index: ip_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v
retrieving revision 1.50.2.13
diff -c -r1.50.2.13 ip_input.c
*** ip_input.c 1998/02/26 17:17:09 1.50.2.13
--- ip_input.c 1998/07/07 16:34:10
***************
*** 953,968 ****
}
if (!ip_dosourceroute) {
! char buf[4*sizeof "123"];
!
nosourcerouting:
! strcpy(buf, inet_ntoa(ip->ip_dst));
! log(LOG_WARNING,
! "attempted source route from %s to %s\n",
! inet_ntoa(ip->ip_src), buf);
! type = ICMP_UNREACH;
! code = ICMP_UNREACH_SRCFAIL;
! goto bad;
}
/*
--- 953,979 ----
}
if (!ip_dosourceroute) {
! if (ipforwarding) {
! char buf[16]; /* aaa.bbb.ccc.ddd\0 */
! /*
! * Acting as a router, so generate ICMP
! */
nosourcerouting:
! strcpy(buf, inet_ntoa(ip->ip_dst));
! log(LOG_WARNING,
! "attempted source route from %s to %s\n",
! inet_ntoa(ip->ip_src), buf);
! type = ICMP_UNREACH;
! code = ICMP_UNREACH_SRCFAIL;
! goto bad;
! } else {
! /*
! * Not acting as a router, so silently drop.
! */
! ipstat.ips_cantforward++;
! m_freem(m);
! return (1);
! }
}
/*
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807071642.JAA26863>
