netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Amnon Aaronsohn <bla@cs.huji.ac.il>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] don't automatically drop packets from 0.0.0.0/8
Date: Wed, 31 May 2006 10:26:49 -0700	[thread overview]
Message-ID: <20060531102649.652f24b5@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.56.0605311958070.8718@duke.cs.huji.ac.il>

On Wed, 31 May 2006 20:07:34 +0300 (IDT)
Amnon Aaronsohn <bla@cs.huji.ac.il> wrote:

> For some reason linux drops all incoming packets which have a source
> address in the 0.0.0.0/8 range, although these are valid addresses. The
> attached patch fixes this. (It still drops packets coming from 0.0.0.0
> since that's a special address.)
> 
> Signed-off-by: Amnon Aaronsohn <bla@cs.huji.ac.il>
> ---
> 
> --- linux-2.6.16.18/net/ipv4/route.c.old	2006-05-30 08:57:42.000000000 +0300
> +++ linux-2.6.16.18/net/ipv4/route.c	2006-05-30 08:58:22.000000000 +0300
> @@ -1935,7 +1935,7 @@ static int ip_route_input_slow(struct sk
>  	/* Accept zero addresses only to limited broadcast;
>  	 * I even do not know to fix it or not. Waiting for complains :-)
>  	 */
> -	if (ZERONET(saddr))
> +	if (saddr == 0)
>  		goto martian_source;
> 
>  	if (BADCLASS(daddr) || ZERONET(daddr) || LOOPBACK(daddr))

Per RFC1122:
           (a)  { 0, 0 }

                 This host on this network.  MUST NOT be sent, except as
                 a source address as part of an initialization procedure
                 by which the host learns its own IP address.

                 See also Section 3.3.6 for a non-standard use of {0,0}.

            (b)  { 0, <Host-number> }

                 Specified host on this network.  It MUST NOT be sent,
                 except as a source address as part of an initialization
                 procedure by which the host learns its full IP address.

So it looks like existing code is correct in dropping packets. Net zero
is intended only for protocols like BOOTP broadcasts.

      reply	other threads:[~2006-05-31 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31 17:07 [PATCH] don't automatically drop packets from 0.0.0.0/8 Amnon Aaronsohn
2006-05-31 17:26 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060531102649.652f24b5@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=bla@cs.huji.ac.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).