netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Maier <andi@cosy.sbg.ac.at>
To: netdev@oss.sgi.com
Subject: Hide AF_INET
Date: Thu, 04 Nov 2004 13:13:10 +0000	[thread overview]
Message-ID: <1099573990l.4491l.1l@leu> (raw)

I need a Linux testbed to test applications in an IPv6-only  
environment. Unfortunately IPv6 cannot be enabled without also enabling  
IPv4. Therefor I try to hide AF_INET from user space with the appended  
patch.

It is a partial success in that AF_INET is no longer available to user  
space, the kernel does not crash, TCP6 connections (ssh) work and UDP6  
connections seem to work (DNS).

The drawback is that ICMP6 (ping6) does not work and that I think my  
basic approach is ugly.

What could be a quick hack to get ICMP6 working in my scenario?

Would it be possible - with reasonable effort - to convert networking  
code so that IPv6 no longer depends on IPv4 so that an IPv6-only  
configuration can be created easily?

Thanks for your help,
-andi


--- net/ipv4/af_inet.c.orig	2004-10-29 15:01:42.000000000 +0200
+++ net/ipv4/af_inet.c	2004-11-04 11:57:11.000000000 +0100
@@ -1032,7 +1032,10 @@
 	 *	Tell SOCKET that we are alive...
 	 */

+#define HIDE_V4
+#ifndef HIDE_V4
   	(void)sock_register(&inet_family_ops);
+#endif

 	/*
 	 *	Add all the base protocols.
@@ -1066,9 +1069,11 @@
   	 *	Set the IP module up
   	 */

+#ifndef HIDE_V4
 	ip_init();

 	tcp_v4_init(&inet_family_ops);
+#endif

 	/* Setup TCP slab cache for open requests. */
 	tcp_init();
@@ -1078,7 +1083,9 @@
 	 *	Set the ICMP layer up
 	 */

+#ifndef HIDE_V4
 	icmp_init(&inet_family_ops);
+#endif

 	/*
 	 *	Initialise the multicast router
@@ -1093,7 +1100,9 @@
 	if(init_ipv4_mibs())
 		printk(KERN_CRIT "inet_init: Cannot init ipv4 mibs\n"); ;
 	
+#ifndef HIDE_V4
 	ipv4_proc_init();
+#endif

 	ipfrag_init();

-- 
| Andreas Maier               Paris-Lodron University of Salzburg   |
| (andi [at] cosy.sbg.ac.at)  Department of Scientific Computing    |
| Tel. +43/662/8044-6339      Jakob Haringerstr. 2                  |
| Fax. +43/662/8044-172       5020 Salzburg / Austria, Europe       |

                 reply	other threads:[~2004-11-04 13:13 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=1099573990l.4491l.1l@leu \
    --to=andi@cosy.sbg.ac.at \
    --cc=netdev@oss.sgi.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).