From owner-freebsd-bugs Tue Jul 7 09:48:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA26069 for freebsd-bugs-outgoing; Tue, 7 Jul 1998 09:48:06 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA26023 for ; Tue, 7 Jul 1998 09:48:00 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id JAA26863; Tue, 7 Jul 1998 09:42:55 -0700 (PDT) Message-Id: <199807071642.JAA26863@implode.root.com> To: Samuel S Thomas cc: Poul-Henning Kamp , freebsd-bugs@FreeBSD.ORG Subject: Re: kern/7191: FreeBSD 2.2.6 generates Source-route prohibited when not routing From: David Greenman Reply-To: dg@root.com Date: Tue, 07 Jul 1998 09:42:55 -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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