Re: Make packets to localhost go through external loopback

Trevor Johnson (trevor@jpj.net)
Mon, 17 May 1999 03:22:32 -0400 (EDT)


> I'm trying to develop driver for network card. As I've only one
> computer (but two cards ;-) available, I'd like trafic for localhost
> to go through external link.
>
> I know this has been here before. Alan's response was that it is only
> good for testing. There was even patch around. Does anyone remember
> what needs to be patched?

Received: from entropy.muc.muohio.edu (IDENT:77@entropy.muc.muohio.edu
[134.53.213.10])
by blues.jpj.net (right/backatcha) with ESMTP id KAA03586
for <trevor@jpj.net>; Sat, 6 Feb 1999 10:44:21 -0500 (EST)
Received: from vger.rutgers.edu (vger.rutgers.edu [128.6.190.2])
by entropy.muc.muohio.edu (Postfix) with ESMTP
id 53A4022606; Fri, 05 Feb 1999 17:28:09 -0500 (EST)
Received: by vger.rutgers.edu via listexpand id <155133-27300>; Fri,
29 Jan 1999 20:35:42 -0500
Received: by vger.rutgers.edu id <154975-27302>; Fri,
29 Jan 1999 20:35:33 -0500
Received: from [209.125.38.15] ([209.125.38.15]:1733 "EHLO
exchange.redcreek.com" ident: "TIMEDOUT") by vger.rutgers.edu with ESMTP id
<154981-27300>; Fri, 29 Jan 1999 20:35:15 -0500
Received: by EXCHANGE with Internet Mail Service (5.5.2448.0)
id <D6VR8ZKB>; Fri, 29 Jan 1999 17:43:37 -0800
Message-ID: <B74EBB896D29D211A43E00805F650DF23BA3DB@EXCHANGE>
From: Brian Moyle <BMoyle@redcreek.com>
To: linux-kernel@vger.rutgers.edu
Subject: [PATCH] linux/net/ipv4/arp.c, kernel 2.0.36
Date: Fri, 29 Jan 1999 17:43:35 -0800
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain
Sender: owner-linux-kernel@vger.rutgers.edu
Precedence: bulk
X-Loop: majordomo@vger.rutgers.edu
X-Orcpt: rfc822;linux-kernel-outgoing-dig

2nd post (previous attempt was reformatted, courtesy of Microsoft Exchange)

Description: Fixes problem with external loopback, using crossed route
entries.
Version: 2.0.36
Testing: Connected two NICs together, using an extenal cross-over cable,
swapped route entries (to force packets out the opposite
interfaces),
and then issued pings to both addreseses. Unplugged cable to
verify
pings were appropriately halted.
Request: Please CC bmoyle@redcreek.com with any comments/feedback. Thanks!

-Brian
bmoyle@redcreek.com

Fix to arp.c for external loopback (Brian Moyle, bmoyle@redcreek.com):
--- linux-2.0.36/net/ipv4/arp.c Sun Nov 15 10:33:21 1998
+++ linux/net/ipv4/arp.c Wed Jan 27 16:59:21 1999
@@ -20,6 +20,8 @@
* 2 of the License, or (at your option) any later version.
*
* Fixes:
+ * Brian Moyle : Fixed arp_set_predefined() to work
with
+ * external loopback w/ crossed routing
* Alan Cox : Removed the ethernet assumptions in
* Florian's code
* Alan Cox : Fixed some small errors in the ARP
@@ -1287,9 +1289,15 @@
switch (addr_hint)
{
case IS_MYADDR:
+ {
+ struct device *dev_found=ip_dev_find(paddr);
printk(KERN_DEBUG "ARP: arp called for own IP
address\n");
- memcpy(haddr, dev->dev_addr, dev->addr_len);
+ if (dev_found)
+ memcpy(haddr, dev_found->dev_addr,
dev_found->addr_len);
+ else
+ memcpy(haddr, dev->dev_addr, dev->addr_len);
return 1;
+ }
#ifdef CONFIG_IP_MULTICAST
case IS_MULTICAST:
if(dev->type==ARPHRD_ETHER ||
dev->type==ARPHRD_IEEE802

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
__
Trevor Johnson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/