kernel-ark/net
Tom Herbert 4465b46900 ipv4: Allow configuring subnets as local addresses
This patch allows a host to be configured to respond to any address in
a specified range as if it were local, without actually needing to
configure the address on an interface.  This is done through routing
table configuration.  For instance, to configure a host to respond
to any address in 10.1/16 received on eth0 as a local address we can do:

ip rule add from all iif eth0 lookup 200
ip route add local 10.1/16 dev lo proto kernel scope host src 127.0.0.1 table 200

This host is now reachable by any 10.1/16 address (route lookup on
input for packets received on eth0 can find the route).  On output, the
rule will not be matched so that this host can still send packets to
10.1/16 (not sent on loopback).  Presumably, external routing can be
configured to make sense out of this.

To make this work, we needed to modify the logic in finding the
interface which is assigned a given source address for output
(dev_ip_find).  We perform a normal fib_lookup instead of just a
lookup on the local table, and in the lookup we ignore the input
interface for matching.

This patch is useful to implement IP-anycast for subnets of virtual
addresses.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-28 23:38:15 -07:00
..
9p net: return operator cleanup 2010-09-23 14:33:39 -07:00
802 net: return operator cleanup 2010-09-23 14:33:39 -07:00
8021q 8021q: Use netif_copy_real_num_queues() to set queue counts 2010-09-27 22:09:57 -07:00
appletalk
atm Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
ax25 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-09 22:27:33 -07:00
bluetooth net: return operator cleanup 2010-09-23 14:33:39 -07:00
bridge bridge : Sanitize skb before it enters the IP stack 2010-09-19 12:42:34 -07:00
caif caif: Use default send and receive buffer size in caif_socket. 2010-09-21 18:05:31 -07:00
can net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
core ipv4: Allow configuring subnets as local addresses 2010-09-28 23:38:15 -07:00
dcb
dccp net: return operator cleanup 2010-09-23 14:33:39 -07:00
decnet net/decnet: Adjust confusing if indentation 2010-08-16 21:06:30 -07:00
dns_resolver DNS: If the DNS server returns an error, allow that to be cached [ver #2] 2010-08-11 17:11:28 +00:00
dsa phylib: available for any speed ethernet 2010-08-11 23:03:50 -07:00
econet net: return operator cleanup 2010-09-23 14:33:39 -07:00
ethernet net: return operator cleanup 2010-09-23 14:33:39 -07:00
ieee802154 ieee802154: Fix possible NULL pointer dereference in wpan_phy_alloc 2010-05-23 23:11:07 -07:00
ipv4 ipv4: Allow configuring subnets as local addresses 2010-09-28 23:38:15 -07:00
ipv6 sit: percpu stats accounting 2010-09-27 21:30:44 -07:00
ipx
irda net: return operator cleanup 2010-09-23 14:33:39 -07:00
iucv net: use __packed annotation 2010-06-03 03:21:52 -07:00
key net: return operator cleanup 2010-09-23 14:33:39 -07:00
l2tp net: constify some ppp/pptp structs 2010-09-21 18:04:47 -07:00
lapb
llc net/llc: storing negative error codes in unsigned short 2010-09-16 22:38:23 -07:00
mac80211 net: return operator cleanup 2010-09-23 14:33:39 -07:00
netfilter Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
netlabel net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00
netlink netlink: Make NETLINK_USERSOCK work again. 2010-08-31 09:51:37 -07:00
netrom
packet net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
phonet Phonet: Implement Pipe Controller to support Nokia Slim Modems 2010-09-27 21:30:41 -07:00
rds Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
rfkill net: return operator cleanup 2010-09-23 14:33:39 -07:00
rose Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
rxrpc Add a dummy printk function for the maintenance of unused printks 2010-08-12 09:51:35 -07:00
sched Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
sctp Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
sunrpc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
tipc net: return operator cleanup 2010-09-23 14:33:39 -07:00
unix Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-09 22:27:33 -07:00
wanrouter net: autoconvert trivial BKL users to private mutex 2010-07-12 20:21:47 -07:00
wimax Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2010-05-20 21:04:44 -07:00
wireless Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-09-27 01:03:03 -07:00
x25 X.25 remove bkl in poll 2010-09-22 13:35:51 -07:00
xfrm xfrm: Allow different selector family in temporary state 2010-09-20 11:11:38 -07:00
compat.c From abbffa2aa9bd6f8df16d0d0a102af677510d8b9a Mon Sep 17 00:00:00 2001 2010-06-03 20:03:40 -07:00
Kconfig net: RPS needs to depend upon USE_GENERIC_SMP_HELPERS 2010-09-14 21:42:22 -07:00
Makefile DNS: Separate out CIFS DNS Resolver code 2010-08-05 17:17:51 +00:00
nonet.c
socket.c net: remove address space warnings in net/socket.c 2010-09-08 13:46:13 -07:00
sysctl_net.c net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00
TUNABLE