net/ipv6: seperate sit driver to extra module (addrconf.c changes)
Subsystems (3)
PATCH 2/2 net/ipv6: seperate sit driver to extra module (addrconf.c changes)
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 <[email protected]>
net/ipv6/addrconf.c +16 -2
@@ -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 *pThis 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 nip6_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 *arif (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 *argreturn 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 naddrconf_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 } elsesit_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 ;
In article <[email protected]> (at Fri, 6 Oct 2006 11:39:27 +0200), Joerg Roedel <[email protected]> says:
Quoted 4 lines
This patch contains the changes to
net/ipv6/addrconf.cto remove sit specific code if the sit driver is not selected.Signed-off-by Joerg Roedel <[email protected]>
Signed-off-by YOSHIFUJI Hideaki <[email protected]>
--yoshfuji