netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro-lkml@zlug.org>
To: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 02/02 V3] net/ipv6: seperate sit driver to extra module (addrconf.c changes)
Date: Tue, 10 Oct 2006 17:43:55 +0200	[thread overview]
Message-ID: <20061010154355.GD27455@zlug.org> (raw)
In-Reply-To: <20061010153745.GA27455@zlug.org>

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

This patch contains the changes to net/ipv6/addrconf.c to remove sit
specific code if the sit driver is not selected.

Signed-off-by: Joerg Roedel <joro-lkml@zlug.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

[-- Attachment #2: patch_sit_as_module_addrconf --]
[-- Type: text/plain, Size: 3111 bytes --]

diff -upr -X linux-2.6.18/Documentation/dontdiff linux-2.6.18-vanilla/net/ipv6/addrconf.c linux-2.6.18/net/ipv6/addrconf.c
--- linux-2.6.18-vanilla/net/ipv6/addrconf.c	2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18/net/ipv6/addrconf.c	2006-10-06 11:04:04.000000000 +0200
@@ -389,8 +389,10 @@ static struct inet6_dev * ipv6_add_dev(s
 	ndev->regen_timer.data = (unsigned long) ndev;
 	if ((dev->flags&IFF_LOOPBACK) ||
 	    dev->type == ARPHRD_TUNNEL ||
-	    dev->type == ARPHRD_NONE ||
-	    dev->type == ARPHRD_SIT) {
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
+	    dev->type == ARPHRD_SIT ||
+#endif
+	    dev->type == ARPHRD_NONE) {
 		printk(KERN_INFO
 		       "%s: Disabled Privacy Extensions\n",
 		       dev->name);
@@ -1522,8 +1524,10 @@ addrconf_prefix_route(struct in6_addr *p
 	   This thing is done here expecting that the whole
 	   class of non-broadcast devices need not cloning.
 	 */
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 	if (dev->type == ARPHRD_SIT && (dev->flags&IFF_POINTOPOINT))
 		rtmsg.rtmsg_flags |= RTF_NONEXTHOP;
+#endif
 
 	ip6_route_add(&rtmsg, NULL, NULL, NULL);
 }
@@ -1545,6 +1549,7 @@ static void addrconf_add_mroute(struct n
 	ip6_route_add(&rtmsg, NULL, NULL, NULL);
 }
 
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 static void sit_route_add(struct net_device *dev)
 {
 	struct in6_rtmsg rtmsg;
@@ -1561,6 +1566,7 @@ static void sit_route_add(struct net_dev
 
 	ip6_route_add(&rtmsg, NULL, NULL, NULL);
 }
+#endif
 
 static void addrconf_add_lroute(struct net_device *dev)
 {
@@ -1831,6 +1837,7 @@ int addrconf_set_dstaddr(void __user *ar
 	if (dev == NULL)
 		goto err_exit;
 
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 	if (dev->type == ARPHRD_SIT) {
 		struct ifreq ifr;
 		mm_segment_t	oldfs;
@@ -1860,6 +1867,7 @@ int addrconf_set_dstaddr(void __user *ar
 			err = dev_open(dev);
 		}
 	}
+#endif
 
 err_exit:
 	rtnl_unlock();
@@ -1993,6 +2001,7 @@ int addrconf_del_ifaddr(void __user *arg
 	return err;
 }
 
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 static void sit_add_v4_addrs(struct inet6_dev *idev)
 {
 	struct inet6_ifaddr * ifp;
@@ -2061,6 +2070,7 @@ static void sit_add_v4_addrs(struct inet
 		}
         }
 }
+#endif
 
 static void init_loopback(struct net_device *dev)
 {
@@ -2124,6 +2134,7 @@ static void addrconf_dev_config(struct n
 		addrconf_add_linklocal(idev, &addr);
 }
 
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 static void addrconf_sit_config(struct net_device *dev)
 {
 	struct inet6_dev *idev;
@@ -2149,6 +2160,7 @@ static void addrconf_sit_config(struct n
 	} else
 		sit_route_add(dev);
 }
+#endif
 
 static inline int
 ipv6_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev)
@@ -2243,9 +2255,11 @@ static int addrconf_notify(struct notifi
 		}
 
 		switch(dev->type) {
+#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
 		case ARPHRD_SIT:
 			addrconf_sit_config(dev);
 			break;
+#endif
 		case ARPHRD_TUNNEL6:
 			addrconf_ip6_tnl_config(dev);
 			break;

  parent reply	other threads:[~2006-10-10 15:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 15:37 [PATCH 01/02 V3] net/ipv6: seperate sit driver to extra module Joerg Roedel
2006-10-10 15:39 ` [PATCH 02/02 V3] net/ipv6: seperate sit driver to extra module (addrconf.c changes) Joerg Roedel
2006-10-10 15:43 ` Joerg Roedel [this message]
2006-10-10 21:50   ` David Miller
2006-10-10 21:47 ` [PATCH 01/02 V3] net/ipv6: seperate sit driver to extra module David Miller
2006-10-13 18:12 ` Jan Dittmer
2006-10-13 19:17   ` Joerg Roedel
2006-10-13 22:06     ` David Miller
2006-10-13 23:09       ` Jan Dittmer
2006-10-14  9:32         ` Joerg Roedel
2006-11-05 22:35           ` Patrick McHardy
2006-11-05 23:27             ` David Miller
2006-11-05 23:38               ` Patrick McHardy
2006-11-05 23:47                 ` David Miller

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=20061010154355.GD27455@zlug.org \
    --to=joro-lkml@zlug.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).