Subject: PATCH to update proxy arp feature on shaper device Author: Roberto Arcomano, berto@fatamorgana.com, http://www.fatamorgana.com/bertolinux Date: 9/9/2001 Description: Shaper device is seen by the kernel like a different device (i.e. shaper0) than the physical one (i.e. eth0) to which is attached: so kernel always issues an "ARP REPLY" (if proxy arp is active on shaper physical interface): this prevent us from use proxy arp on a shaper device cause, during turning on client machine, we would receive an "IP conflit" message. Solution: Patch consists in 4 files: a-) "include/linux/netdevice.h", where we add a new net feature, NETIF_F_SHAPER which will help us to understand if a device is a shaper one. b-) "drivers/net/shaper.c", in "shaper_probe" function we set NETIF_F_SHAPER flag for a new shaper device. c-) "include/linux/if_shaper.h" where we add the macro IS_SHAPERDEVICE, used to know if the device is a shaper one (it checks NETIF_F_SHAPER flag in features field, under "netdevice" struct). d-) "net/ipv4/arp.c" where finally we modify proxy arp; We use shflag to determine if we are managing a shaper device (with IS_SHAPERDEVICE macro): in this case we check "rt->u.dst.dev->priv->dev" (physical device) instead of "rt->u.dst.dev" (shaper device) while if the device is a non shaper one, we check rt->u.dst.dev (anded with !shflag) TODO: I used "features" field in netdevice struct: maybe it could be choosen another place where to put the shaper flag. Tests: I tested new feature using 3 PCs like that: CLIENT1 ------------- LINUX ------------- CLIENT2 shaper0 ppp0 [eth0] LINUX host has proxy arp and shaper enabled, with CLIENT1 reachable via shaper0. With classic proxy arp, when I turn on CLIENT machine I receive an "IP conflit" from OS, while using patched version there are no problems. Proxy arp still does its work cause, if I give CLIENT2 IP address to CLIENT1 machine, I receive (from CLIENT1 OS) a IP busy message. Also tests on commercial server have been done with good results. Kernel version tested is 2.4.9 Final notes: It should be very simple to port patch to older kernel version (2.0.xx, 2.1.xx, 2.2.xx, 2.3.xx)