public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roberto Arcomano <berto@fatamorgana.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] net/ipv4/arp.c, kernel 2.4.6
Date: Thu, 26 Jul 2001 02:31:47 +0200	[thread overview]
Message-ID: <01072602314701.01029@berto.casa.it> (raw)

[-- 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)
	    
	             
	     
	     

                 reply	other threads:[~2001-07-26  0:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01072602314701.01029@berto.casa.it \
    --to=berto@fatamorgana.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox