diff options
author | Joerg Roedel <joro-lkml@zlug.org> | 2006-10-10 17:49:53 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-12 02:59:52 -0400 |
commit | 0be669bb37693103c15e64610454f8f431a38feb (patch) | |
tree | d00e9e00a22c601bf193d6d26d227b4e4c8100b0 | |
parent | 989e5b96e1af399296e2d1a34ca4a5aea1cf6d63 (diff) |
[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 <joro-lkml@zlug.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/addrconf.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e03c33b2465b..b312a5f7a759 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -396,8 +396,10 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
396 | ndev->regen_timer.data = (unsigned long) ndev; | 396 | ndev->regen_timer.data = (unsigned long) ndev; |
397 | if ((dev->flags&IFF_LOOPBACK) || | 397 | if ((dev->flags&IFF_LOOPBACK) || |
398 | dev->type == ARPHRD_TUNNEL || | 398 | dev->type == ARPHRD_TUNNEL || |
399 | dev->type == ARPHRD_NONE || | 399 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) |
400 | dev->type == ARPHRD_SIT) { | 400 | dev->type == ARPHRD_SIT || |
401 | #endif | ||
402 | dev->type == ARPHRD_NONE) { | ||
401 | printk(KERN_INFO | 403 | printk(KERN_INFO |
402 | "%s: Disabled Privacy Extensions\n", | 404 | "%s: Disabled Privacy Extensions\n", |
403 | dev->name); | 405 | dev->name); |
@@ -1546,8 +1548,10 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev, | |||
1546 | This thing is done here expecting that the whole | 1548 | This thing is done here expecting that the whole |
1547 | class of non-broadcast devices need not cloning. | 1549 | class of non-broadcast devices need not cloning. |
1548 | */ | 1550 | */ |
1551 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
1549 | if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT)) | 1552 | if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT)) |
1550 | cfg.fc_flags |= RTF_NONEXTHOP; | 1553 | cfg.fc_flags |= RTF_NONEXTHOP; |
1554 | #endif | ||
1551 | 1555 | ||
1552 | ip6_route_add(&cfg); | 1556 | ip6_route_add(&cfg); |
1553 | } | 1557 | } |
@@ -1569,6 +1573,7 @@ static void addrconf_add_mroute(struct net_device *dev) | |||
1569 | ip6_route_add(&cfg); | 1573 | ip6_route_add(&cfg); |
1570 | } | 1574 | } |
1571 | 1575 | ||
1576 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
1572 | static void sit_route_add(struct net_device *dev) | 1577 | static void sit_route_add(struct net_device *dev) |
1573 | { | 1578 | { |
1574 | struct fib6_config cfg = { | 1579 | struct fib6_config cfg = { |
@@ -1582,6 +1587,7 @@ static void sit_route_add(struct net_device *dev) | |||
1582 | /* prefix length - 96 bits "::d.d.d.d" */ | 1587 | /* prefix length - 96 bits "::d.d.d.d" */ |
1583 | ip6_route_add(&cfg); | 1588 | ip6_route_add(&cfg); |
1584 | } | 1589 | } |
1590 | #endif | ||
1585 | 1591 | ||
1586 | static void addrconf_add_lroute(struct net_device *dev) | 1592 | static void addrconf_add_lroute(struct net_device *dev) |
1587 | { | 1593 | { |
@@ -1852,6 +1858,7 @@ int addrconf_set_dstaddr(void __user *arg) | |||
1852 | if (dev == NULL) | 1858 | if (dev == NULL) |
1853 | goto err_exit; | 1859 | goto err_exit; |
1854 | 1860 | ||
1861 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
1855 | if (dev->type == ARPHRD_SIT) { | 1862 | if (dev->type == ARPHRD_SIT) { |
1856 | struct ifreq ifr; | 1863 | struct ifreq ifr; |
1857 | mm_segment_t oldfs; | 1864 | mm_segment_t oldfs; |
@@ -1881,6 +1888,7 @@ int addrconf_set_dstaddr(void __user *arg) | |||
1881 | err = dev_open(dev); | 1888 | err = dev_open(dev); |
1882 | } | 1889 | } |
1883 | } | 1890 | } |
1891 | #endif | ||
1884 | 1892 | ||
1885 | err_exit: | 1893 | err_exit: |
1886 | rtnl_unlock(); | 1894 | rtnl_unlock(); |
@@ -2010,6 +2018,7 @@ int addrconf_del_ifaddr(void __user *arg) | |||
2010 | return err; | 2018 | return err; |
2011 | } | 2019 | } |
2012 | 2020 | ||
2021 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
2013 | static void sit_add_v4_addrs(struct inet6_dev *idev) | 2022 | static void sit_add_v4_addrs(struct inet6_dev *idev) |
2014 | { | 2023 | { |
2015 | struct inet6_ifaddr * ifp; | 2024 | struct inet6_ifaddr * ifp; |
@@ -2078,6 +2087,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev) | |||
2078 | } | 2087 | } |
2079 | } | 2088 | } |
2080 | } | 2089 | } |
2090 | #endif | ||
2081 | 2091 | ||
2082 | static void init_loopback(struct net_device *dev) | 2092 | static void init_loopback(struct net_device *dev) |
2083 | { | 2093 | { |
@@ -2141,6 +2151,7 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2141 | addrconf_add_linklocal(idev, &addr); | 2151 | addrconf_add_linklocal(idev, &addr); |
2142 | } | 2152 | } |
2143 | 2153 | ||
2154 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
2144 | static void addrconf_sit_config(struct net_device *dev) | 2155 | static void addrconf_sit_config(struct net_device *dev) |
2145 | { | 2156 | { |
2146 | struct inet6_dev *idev; | 2157 | struct inet6_dev *idev; |
@@ -2166,6 +2177,7 @@ static void addrconf_sit_config(struct net_device *dev) | |||
2166 | } else | 2177 | } else |
2167 | sit_route_add(dev); | 2178 | sit_route_add(dev); |
2168 | } | 2179 | } |
2180 | #endif | ||
2169 | 2181 | ||
2170 | static inline int | 2182 | static inline int |
2171 | ipv6_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev) | 2183 | ipv6_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev) |
@@ -2260,9 +2272,11 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, | |||
2260 | } | 2272 | } |
2261 | 2273 | ||
2262 | switch(dev->type) { | 2274 | switch(dev->type) { |
2275 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | ||
2263 | case ARPHRD_SIT: | 2276 | case ARPHRD_SIT: |
2264 | addrconf_sit_config(dev); | 2277 | addrconf_sit_config(dev); |
2265 | break; | 2278 | break; |
2279 | #endif | ||
2266 | case ARPHRD_TUNNEL6: | 2280 | case ARPHRD_TUNNEL6: |
2267 | addrconf_ip6_tnl_config(dev); | 2281 | addrconf_ip6_tnl_config(dev); |
2268 | break; | 2282 | break; |