kernel_optimize_test/include
Simon Kelley bd89efc532 [NEIGH]: Fix IP-over-ATM and ARP interaction.
The classical IP over ATM code maintains its own IPv4 <-> <ATM stuff>
ARP table, using the standard neighbour-table code. The
neigh_table_init function adds this neighbour table to a linked list
of all neighbor tables which is used by the functions neigh_delete()
neigh_add() and neightbl_set(), all called by the netlink code.

Once the ATM neighbour table is added to the list, there are two
tables with family == AF_INET there, and ARP entries sent via netlink
go into the first table with matching family. This is indeterminate
and often wrong.

To see the bug, on a kernel with CLIP enabled, create a standard IPv4
ARP entry by pinging an unused address on a local subnet. Then attempt
to complete that entry by doing

ip neigh replace <ip address> lladdr <some mac address> nud reachable

Looking at the ARP tables by using 

ip neigh show

will reveal two ARP entries for the same address. One of these can be
found in /proc/net/arp, and the other in /proc/net/atm/arp.

This patch adds a new function, neigh_table_init_no_netlink() which
does everything the neigh_table_init() does, except add the table to
the netlink all-arp-tables chain. In addition neigh_table_init() has a
check that all tables on the chain have a distinct address family.
The init call in clip.c is changed to call
neigh_table_init_no_netlink().

Since ATM ARP tables are rather more complicated than can currently be
handled by the available rtattrs in the netlink protocol, no
functionality is lost by this patch, and non-ATM ARP manipulation via
netlink is rescued. A more complete solution would involve a rtattr
for ATM ARP entries and some way for the netlink code to give
neigh_add and friends more information than just address family with
which to find the correct ARP table.

[ I've changed the assertion checking in neigh_table_init() to not
  use BUG_ON() while holding neigh_tbl_lock.  Instead we remember that
  we found an existing tbl with the same family, and after dropping
  the lock we'll give a diagnostic kernel log message and a stack dump.
  -DaveM ]

Signed-off-by: Simon Kelley <simon@thekelleys.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-05-12 14:56:08 -07:00
..
acpi
asm-alpha
asm-arm [ARM] 3506/1: aaec2000: debug-macro.S needs hardware.h 2006-05-07 22:49:23 +01:00
asm-arm26
asm-cris
asm-frv
asm-generic
asm-h8300
asm-i386 [PATCH] x86_64: avoid IRQ0 ioapic pin collision 2006-05-08 09:34:56 -07:00
asm-ia64 [IA64] remove asm-ia64/bitops.h self-inclusion 2006-05-05 11:37:15 -07:00
asm-m32r
asm-m68k
asm-m68knommu
asm-mips
asm-parisc
asm-powerpc powerpc: Fix incorrect might_sleep in __get_user/__put_user on kernel addresses 2006-05-03 23:06:46 +10:00
asm-ppc powerpc/32: Define an is_kernel_addr() to fix ARCH=ppc compilation 2006-05-09 16:00:59 +10:00
asm-s390
asm-sh
asm-sh64
asm-sparc [SPARC]: Hook up vmsplice into syscall tables. 2006-05-03 13:55:46 -07:00
asm-sparc64 [SPARC]: Hook up vmsplice into syscall tables. 2006-05-03 13:55:46 -07:00
asm-um
asm-v850
asm-x86_64 [PATCH] x86_64: Avoid EBDA area in early boot allocator 2006-05-08 09:34:56 -07:00
asm-xtensa
keys
linux Merge master.kernel.org:/home/rmk/linux-2.6-serial 2006-05-11 15:46:42 -07:00
math-emu
media
mtd
net [NEIGH]: Fix IP-over-ATM and ARP interaction. 2006-05-12 14:56:08 -07:00
pcmcia
rdma
rxrpc
scsi
sound
video