Re: 2.1.12 & routing

Herbert Xu (herbert@greathan.apana.org.au)
Mon, 2 Dec 1996 19:31:45 +1100 (EST)


I am still having problems with IPv4 forwarding in 2.1.14. Removing
the snooping patch cures the problem. Am I doing something totally
weird? If you want my .config file, it's available at

http://greathan.apana.org.au/~herbert/config

The symptom of the problem is that packets seem to be lost when
forwarded. For instance, pinging would result in a loss rate of
~50%. The two interfaces in question are eth0 (SMC ultra) and
PPP.

Here's the patch that seems to have caused this.

> diff -u --recursive --new-file v2.1.10/linux/net/ipv4/ip_forward.c linux/net/ipv4/ip_forward.c
> --- v2.1.10/linux/net/ipv4/ip_forward.c Thu Oct 10 19:10:58 1996
> +++ linux/net/ipv4/ip_forward.c Mon Nov 18 11:31:35 1996
> @@ -16,6 +16,7 @@
> * use output device for accounting.
> * Jos Vos : Call forward firewall after routing
> * (always use output device).
> + * Alan Cox : Unshare buffer on forward.
> */
>
> #include <linux/config.h>
> @@ -120,6 +121,13 @@
> struct sk_buff *skb_in = skb; /* So we can remember if the masquerader did some swaps */
> #endif /* CONFIG_IP_MASQUERADE */
> #endif /* CONFIG_FIREWALL */
> +
> + /*
> + * We may be sharing the buffer with a snooper. That won't do
> + */
> +
> + if((skb=skb_unshare(skb, GFP_ATOMIC,FREE_READ))==NULL)
> + return -1;
>
> /*
> * According to the RFC, we must first decrease the TTL field. If
>

-- 
Debian GNU/Linux 1.1 is out! { http://www.debian.org/ }
Email:  Herbert Xu ~{PmV>HI~} <herbert@greathan.apana.org.au>
{ http://greathan.apana.org.au/~herbert/ }
PGP Key:  pgp-public-keys@pgp.mit.edu or any other key sites