Subtleties of the netmask (inet_ifa_match)

From: Allen Lau (
Date: Wed Jul 25 2001 - 21:04:31 EST


This is a load balancing specific question. We configure load balancer IP addresses (which are regular
addresses like on the loopback interface with 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 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 netmask which should not match any
route entry except the host entry itself within the box.

  o Are there subtle differences between and netmasks?

The inet_ifa_match function seems to be wrong with 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 netmask matches everything! For example:
        addr= ifa_address= ifa_mask= inet_ifa_match=1
        addr= ifa_address= ifa_mask= inet_ifa_match=0

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

Thanks for any info.
Allen Lau

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:25 EST