mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Allen Lau" <pflau@us.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: Subtleties of the 0.0.0.0 netmask (inet_ifa_match)
Date: Wed, 25 Jul 2001 22:04:31 -0400	[thread overview]
Message-ID: <OFDE143062.D41C03AC-ON85256A95.000B439D@raleigh.ibm.com> (raw)

Hi,

This is a load balancing specific question. We configure load balancer IP addresses (which are regular
addresses like 10.1.1.1) on the loopback interface with 0.0.0.0 netmask. The purpose is to receive
clients requests with those address, and for routing to ignore them when sending the replies.

  o Does addresses with 0.0.0.0 netmask have scope RT_SCOPE_NOWHERE?
  o and does it imply that routing would never route to them?

We also configure load balancer IP address with 255.255.255.255 netmask which should not match any
route entry except the host entry itself within the box.

  o Are there subtle differences between 0.0.0.0 and 255.255.255.255 netmasks?

The inet_ifa_match function seems to be wrong with 0.0.0.0 netmask.  Who uses it?

extern __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
{
        return !((addr^ifa->ifa_address)&ifa->ifa_mask);
}

The 0.0.0.0 netmask matches everything! For example:
        addr=9.9.9.9  ifa_address=10.1.1.1  ifa_mask=0.0.0.0          inet_ifa_match=1
        addr=9.9.9.9  ifa_address=10.1.1.1  ifa_mask=255.255.255.255  inet_ifa_match=0

Will there be any routing problems if we use the 0.0.0.0 netmask?

Thanks for any info.
Allen Lau



             reply	other threads:[~2001-07-26  2:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-26  2:04 Allen Lau [this message]
2001-07-27  0:32 ` Alexey Kuznetsov
2001-07-27 19:03 Allen Lau
     [not found] <OFA1B2627C.7E519218-ON85256A96.00641020@raleigh.ibm.com >
2001-07-27 19:06 ` kuznet
2001-07-27 21:27   ` Joshua M. Thompson

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=OFDE143062.D41C03AC-ON85256A95.000B439D@raleigh.ibm.com \
    --to=pflau@us.ibm.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®