netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: emann@mrv.com (Eran Mann)
To: Zdenek Radouch <zdenek@rcn.com>
Cc: Thomas Graf <tgraf@suug.ch>, Andi Kleen <ak@muc.de>,
	Martin Mares <mj@ucw.cz>,
	netdev@oss.sgi.com, linux-net@vger.kernel.org
Subject: Re: Do you know the TCP stack? (127.x.x.x routing)
Date: Mon, 07 Mar 2005 10:05:36 +0200	[thread overview]
Message-ID: <422C0B50.20500@mrv.com> (raw)
In-Reply-To: <3sp35g$7hpm0@smtp04.mrf.mail.rcn.net>

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

Zdenek Radouch wrote:
...
> 
> 2) If it does require kernel hacking, would you like to do it for me?
>     (as I had said, as a contract)
I think what Andi Kleen was talking about below is something like the 
attached 5 minutes patch (applies cleanly to 2.4.2x kernels I have at 
hand, and to 2.6.11 with minor offset). Please donate the 5 minute wages 
to the OSDL or the FSF at your choice ;-)
...
> 
> Not accepting packets with with a loopback address is one
> thing, not accepting any 127.0.0.0/8 packets is entirely something else.

Yes, however it seems to be required by the RFC (quoting RFC 3330 
"special use IPv4 addresses") :

"  127.0.0.0/8 - This block is assigned for use as the Internet host
    loopback address.  A datagram sent by a higher level protocol to an
    address anywhere within this block should loop back inside the host.
    This is ordinarily implemented using only 127.0.0.1/32 for loopback,
    but no addresses within this block should ever appear on any network
    anywhere [RFC1700, page 5]. "

>>* Andi Kleen <m1y8d0mss2.fsf@muc.de> 2005-03-06 21:19
>>
...
>>>
>>>It is. 127.* is hardcoded in the routing engine and e.g.
>>>it won't accept outside packets with a loopback address.
>>>
>>>Most likely it's enough to change the "LOOPBACK" macro to allow
>>>parts of the Class A to be used for other purposes.
...
-- 
Eran Mann
MRV International

[-- Attachment #2: lo_hack.patch --]
[-- Type: text/x-patch, Size: 969 bytes --]

--- 2.4.27/include/linux/in.h	2004-05-28 17:15:37.000000000 +0300
+++ 2.4.27.hacked/include/linux/in.h	2005-03-07 09:53:02.000000000 +0200
@@ -226,7 +226,7 @@
 
 /* Address to loopback in software to local host.  */
 #define	INADDR_LOOPBACK		0x7f000001	/* 127.0.0.1   */
-#define	IN_LOOPBACK(a)		((((long int) (a)) & 0xff000000) == 0x7f000000)
+#define	IN_LOOPBACK(a)		((((long int) (a)) & 0xffff0000) == 0x7f000000)
 
 /* Defines for Multicast INADDR */
 #define INADDR_UNSPEC_GROUP   	0xe0000000U	/* 224.0.0.0   */
@@ -240,7 +240,7 @@
 
 #ifdef __KERNEL__
 /* Some random defines to make it easier in the kernel.. */
-#define LOOPBACK(x)	(((x) & htonl(0xff000000)) == htonl(0x7f000000))
+#define LOOPBACK(x)	(((x) & htonl(0xffff0000)) == htonl(0x7f000000))
 #define MULTICAST(x)	(((x) & htonl(0xf0000000)) == htonl(0xe0000000))
 #define BADCLASS(x)	(((x) & htonl(0xf0000000)) == htonl(0xf0000000))
 #define ZERONET(x)	(((x) & htonl(0xff000000)) == htonl(0x00000000))

  parent reply	other threads:[~2005-03-07  8:05 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06  2:20 Do you know the TCP stack? (127.x.x.x routing) Zdenek Radouch
2005-03-06  9:56 ` Martin Mares
2005-03-06 17:01   ` Zdenek Radouch
2005-03-06 17:12     ` alex
2005-03-06 17:31     ` Thomas Graf
2005-03-06 19:48       ` Zdenek Radouch
2005-03-06 20:19         ` alex
2005-03-06 20:19         ` Andi Kleen
2005-03-06 20:45           ` Thomas Graf
2005-03-06 21:30             ` Andi Kleen
2005-03-06 21:50               ` Thomas Graf
2005-03-06 21:50             ` Zdenek Radouch
2005-03-07  7:01               ` Sumit Pandya
2005-03-07  8:05               ` Eran Mann [this message]
2005-03-07 12:14                 ` jamal
2005-03-07 23:50                 ` jamal
2005-03-08  3:15                   ` Zdenek Radouch
2005-03-08 13:34                     ` jamal
2005-03-08 13:51                       ` Martin Mares
2005-03-08 13:58                         ` jamal
2005-03-08 14:03                           ` Martin Mares
2005-03-08 14:17                             ` jamal
2005-03-08 14:20                               ` Martin Mares
2005-03-08 18:40                               ` Henrik Nordstrom
2005-03-08 21:17                                 ` jamal
2005-03-09  9:09                                   ` Henrik Nordstrom
2005-03-09 12:39                                     ` jamal
2005-03-09 13:39                                       ` Zdenek Radouch
2005-03-09 14:18                                         ` jamal
2005-03-09 16:46                                           ` Jason Lunz
2005-03-10 10:10                                             ` Henrik Nordstrom
2005-03-09 17:52                                           ` Matt Mackall
2005-03-10  6:57                                             ` Catalin(ux aka Dino) BOIE
2005-03-09 22:34                                       ` Henrik Nordstrom
2005-03-10  1:47                                         ` Jamie Lokier
2005-03-08 18:34                       ` Henrik Nordstrom
2005-03-09  5:33                       ` Zdenek Radouch
2005-03-08 14:02                     ` Thomas Graf
  -- strict thread matches above, loose matches on Subject: below --
2005-03-08 15:07 Steve Iribarne
2005-03-09 15:01 Steve Iribarne
2005-03-09 16:00 ` jamal
2005-03-10  6:48 ` Catalin(ux aka Dino) BOIE
2005-03-09 17:33 Steve Iribarne
2005-03-09 19:40 ` jamal
2005-03-09 21:57 Steve Iribarne
2005-03-10  0:11 ` jamal
2005-03-09 23:51 Boian Bonev
2005-03-10  0:23 ` Jason Lunz
2005-03-10 14:35 Steve Iribarne
2005-03-10 14:49 ` Dmitry Torokhov
2005-03-10 15:04 Steve Iribarne
2005-03-10 15:25 ` Catalin(ux aka Dino) BOIE

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=422C0B50.20500@mrv.com \
    --to=emann@mrv.com \
    --cc=ak@muc.de \
    --cc=linux-net@vger.kernel.org \
    --cc=mj@ucw.cz \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    --cc=zdenek@rcn.com \
    /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;
as well as URLs for NNTP newsgroup(s).