* [PATCH] net/ipv4/arp.c, kernel 2.4.6
@ 2001-07-26 0:31 Roberto Arcomano
0 siblings, 0 replies; only message in thread
From: Roberto Arcomano @ 2001-07-26 0:31 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
This patch should update proxy arp feature for shaper device. Details are in
README file attached.
Thank you for your support.
Best Regards
Roberto Arcomano
[-- Attachment #2: Diff file for arp.c --]
[-- Type: text/x-c, Size: 967 bytes --]
--- linux-2.4.6.orig/net/ipv4/arp.c Wed May 16 19:21:45 2001
+++ linux-2.4.6/net/ipv4/arp.c Thu Jul 26 02:00:35 2001
@@ -111,6 +111,7 @@
#include <asm/system.h>
#include <asm/uaccess.h>
+#include <linux/if_shaper.h>
@@ -767,8 +768,15 @@
}
goto out;
} else if (IN_DEV_FORWARD(in_dev)) {
+ char shflag=0;
+ if ( (rt->u.dst.dev) &&
+ (rt->u.dst.dev->priv) &&
+ (((struct shaper *) rt->u.dst.dev->priv)->dev) &&
+ (strncmp(rt->u.dst.dev->name,"shaper",6)==0) )
+ shflag=1;
if ((rt->rt_flags&RTCF_DNAT) ||
- (addr_type == RTN_UNICAST && rt->u.dst.dev != dev &&
+ (addr_type == RTN_UNICAST &&
+ ( ((shflag) && ( ((struct shaper *) rt->u.dst.dev->priv)->dev != dev)) || ((!shflag) && (rt->u.dst.dev != dev)) ) &&
(IN_DEV_PROXY_ARP(in_dev) || pneigh_lookup(&arp_tbl, &tip, dev, 0)))) {
n = neigh_event_ns(&arp_tbl, sha, &sip, dev);
if (n)
[-- Attachment #3: Readme for proxy arp PATCH --]
[-- Type: text/x-c, Size: 1655 bytes --]
Subject: PATCH to update proxy arp feature on shaper device
Author: Roberto Arcomano, berto@fatamorgana.com,
http://www.fatamorgana.com/bertolinux
Date: 07/22/2001
Description: Shaper device is seen by the kernel like a
different device than the physical one to which
is attached to. So kernel always issues an
"ARP REPLY" (if proxy arp is active): this
prevent us to enable proxy arp (on a shaper device)
and turn on machine cause we would receive
an "IP conflit".
Solution: The patch investigates about the shaper device
(it compares string with "shaper"): if yes, we
search the real interface attached to shaper
(we read value of priv->dev) and we use that to
make the classic proxy arp devices compare.
Problems: The patch uses routine "strncmp" which is not the
best thing (I guess).
Tests: I tested new feature using 3 PC like that:
CLIENT1 ----------- LINUX ----- CLIENT2
shaper0 ppp0
[eth0]
LINUX host has proxy arp and shaper enabled, with
a routing (using shaper0 interface) to CLIENT1
If I use old feature, when I turn on CLIENT1 I receive
an "IP conflit" by its OS, while using patched version
I have no problem and proxy arp feature for CLIENT2
works well (as right, I cannot assign CLIENT2 IP to
CLIENT1 host).
Kernel version tested is 2.4.6
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-26 0:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-26 0:31 [PATCH] net/ipv4/arp.c, kernel 2.4.6 Roberto Arcomano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox