diff options
| author | Adrian Bunk <bunk@stusta.de> | 2005-01-13 21:31:38 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2005-01-13 21:31:38 -0800 |
| commit | c749c9cc5bcfedc42f0b47c2ce4604e7fa2faf5a (patch) | |
| tree | 4816ff46fa593658db9e88390c89fb433251ca69 | |
| parent | b218528821d513e0da96456d95c19271cfe05321 (diff) | |
[IPV6]: Misc cleanups.
- make some needlessly global code static
- remove the following unused functions:
- exthdrs.c: ipv6_build_rthdr
- exthdrs.c: ipv6_build_exthdr
- exthdrs.c: ipv6_build_nfrag_opts
- exthdrs.c: ipv6_build_frag_opts
- remove the following write-only global variables:
- addrconf.c: inet6_dev_count
- addrconf.c: inet6_ifa_count
- #if 0 the following unused global variable:
- addrconf.c: in6addr_any
- remove the following unneeded EXPORT_SYMBOL's:
- ipv6_syms.c: in6addr_any
- ipv6_syms.c: in6addr_loopback
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/linux/in6.h | 2 | ||||
| -rw-r--r-- | include/net/addrconf.h | 1 | ||||
| -rw-r--r-- | include/net/ipv6.h | 2 | ||||
| -rw-r--r-- | net/ipv6/addrconf.c | 9 | ||||
| -rw-r--r-- | net/ipv6/anycast.c | 4 | ||||
| -rw-r--r-- | net/ipv6/exthdrs.c | 77 | ||||
| -rw-r--r-- | net/ipv6/icmp.c | 2 | ||||
| -rw-r--r-- | net/ipv6/ip6_output.c | 2 | ||||
| -rw-r--r-- | net/ipv6/ipv6_syms.c | 2 | ||||
| -rw-r--r-- | net/ipv6/mcast.c | 32 | ||||
| -rw-r--r-- | net/ipv6/route.c | 4 | ||||
| -rw-r--r-- | net/ipv6/sysctl_net_ipv6.c | 2 |
12 files changed, 30 insertions, 109 deletions
diff --git a/include/linux/in6.h b/include/linux/in6.h index 5b4e89b1ac68..f8256c582845 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -44,8 +44,10 @@ struct in6_addr * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined * in network byte order, not in host byte order as are the IPv4 equivalents */ +#if 0 extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } +#endif extern const struct in6_addr in6addr_loopback; #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 97c2a6121275..bfcc02447b6b 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -112,7 +112,6 @@ extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex); extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr); -extern int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); extern int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr); diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 445fbfd71589..dc1feea01acb 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -229,8 +229,6 @@ extern int ip6_ra_control(struct sock *sk, int sel, void (*destructor)(struct sock *)); -extern int ip6_call_ra_chain(struct sk_buff *skb, int sel); - extern int ipv6_parse_hopopts(struct sk_buff *skb, int); extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3d643d30f64f..fecf022809ae 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -99,9 +99,6 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf static void addrconf_sysctl_unregister(struct ipv6_devconf *p); #endif -int inet6_dev_count; -int inet6_ifa_count; - #ifdef CONFIG_IPV6_PRIVACY static int __ipv6_regen_rndid(struct inet6_dev *idev); static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr); @@ -191,7 +188,9 @@ static struct ipv6_devconf ipv6_devconf_dflt = { }; /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ +#if 0 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +#endif const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; int ipv6_addr_type(const struct in6_addr *addr) @@ -310,7 +309,6 @@ void in6_dev_finish_destroy(struct inet6_dev *idev) return; } snmp6_unregister_dev(idev); - inet6_dev_count--; kfree(idev); } @@ -338,7 +336,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) kfree(ndev); return NULL; } - inet6_dev_count++; /* We refer to the device */ dev_hold(dev); @@ -475,7 +472,6 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) } dst_release(&ifp->rt->u.dst); - inet6_ifa_count--; kfree(ifp); } @@ -530,7 +526,6 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen, ifa->flags = flags | IFA_F_TENTATIVE; ifa->cstamp = ifa->tstamp = jiffies; - inet6_ifa_count++; ifa->idev = idev; in6_dev_hold(idev); /* For caller */ diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 549223dd38c7..410a1ab9c698 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c @@ -43,6 +43,8 @@ #include <net/checksum.h> +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); + /* Big ac list lock for all the sockets */ static DEFINE_RWLOCK(ipv6_sk_ac_lock); @@ -413,7 +415,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr) return 0; } -int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) { int ret; struct inet6_dev *idev = in6_dev_get(dev); diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 2b78c840c349..e0839eafc3a9 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -501,83 +501,6 @@ int ipv6_parse_hopopts(struct sk_buff *skb, int nhoff) * for headers. */ -static u8 *ipv6_build_rthdr(struct sk_buff *skb, u8 *prev_hdr, - struct ipv6_rt_hdr *opt, struct in6_addr *addr) -{ - struct rt0_hdr *phdr, *ihdr; - int hops; - - ihdr = (struct rt0_hdr *) opt; - - phdr = (struct rt0_hdr *) skb_put(skb, (ihdr->rt_hdr.hdrlen + 1) << 3); - memcpy(phdr, ihdr, sizeof(struct rt0_hdr)); - - hops = ihdr->rt_hdr.hdrlen >> 1; - - if (hops > 1) - memcpy(phdr->addr, ihdr->addr + 1, - (hops - 1) * sizeof(struct in6_addr)); - - ipv6_addr_copy(phdr->addr + (hops - 1), addr); - - phdr->rt_hdr.nexthdr = *prev_hdr; - *prev_hdr = NEXTHDR_ROUTING; - return &phdr->rt_hdr.nexthdr; -} - -static u8 *ipv6_build_exthdr(struct sk_buff *skb, u8 *prev_hdr, u8 type, struct ipv6_opt_hdr *opt) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_put(skb, ipv6_optlen(opt)); - - memcpy(h, opt, ipv6_optlen(opt)); - h->nexthdr = *prev_hdr; - *prev_hdr = type; - return &h->nexthdr; -} - -u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt, - struct in6_addr *daddr, u32 jumbolen) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb->data; - - if (opt && opt->hopopt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_HOP, opt->hopopt); - - if (jumbolen) { - u8 *jumboopt = (u8 *)skb_put(skb, 8); - - if (opt && opt->hopopt) { - *jumboopt++ = IPV6_TLV_PADN; - *jumboopt++ = 0; - h->hdrlen++; - } else { - h = (struct ipv6_opt_hdr *)jumboopt; - h->nexthdr = *prev_hdr; - h->hdrlen = 0; - jumboopt += 2; - *prev_hdr = NEXTHDR_HOP; - prev_hdr = &h->nexthdr; - } - jumboopt[0] = IPV6_TLV_JUMBO; - jumboopt[1] = 4; - *(u32*)(jumboopt+2) = htonl(jumbolen); - } - if (opt) { - if (opt->dst0opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst0opt); - if (opt->srcrt) - prev_hdr = ipv6_build_rthdr(skb, prev_hdr, opt->srcrt, daddr); - } - return prev_hdr; -} - -u8 *ipv6_build_frag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt) -{ - if (opt->dst1opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst1opt); - return prev_hdr; -} - static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, struct ipv6_rt_hdr *opt, struct in6_addr **addr_p) diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 26273c82f9fc..e9eca00e0e41 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -211,7 +211,7 @@ static __inline__ int opt_unrec(struct sk_buff *skb, __u32 offset) return (*op & 0xC0) == 0x80; } -int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) +static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) { struct sk_buff *skb; struct icmp6hdr *icmp6h; diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 595141b8d5de..37abe7141d14 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -311,7 +311,7 @@ int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev, return 0; } -int ip6_call_ra_chain(struct sk_buff *skb, int sel) +static int ip6_call_ra_chain(struct sk_buff *skb, int sel) { struct ip6_ra_chain *ra; struct sock *last = NULL; diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c index a2d9601f98d3..2f4c91ddc9a3 100644 --- a/net/ipv6/ipv6_syms.c +++ b/net/ipv6/ipv6_syms.c @@ -32,8 +32,6 @@ EXPORT_SYMBOL(inet6_getname); EXPORT_SYMBOL(inet6_ioctl); EXPORT_SYMBOL(ipv6_get_saddr); EXPORT_SYMBOL(ipv6_chk_addr); -EXPORT_SYMBOL(in6addr_any); -EXPORT_SYMBOL(in6addr_loopback); EXPORT_SYMBOL(in6_dev_finish_destroy); #ifdef CONFIG_XFRM EXPORT_SYMBOL(xfrm6_rcv); diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 8fe1cea11a6f..393b6e6f50a9 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -121,7 +121,7 @@ struct mld2_query { struct in6_addr srcs[0]; }; -struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; +static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; /* Big mc list lock for all the sockets */ static DEFINE_RWLOCK(ipv6_sk_mc_lock); @@ -143,12 +143,14 @@ static void mld_clear_delrec(struct inet6_dev *idev); static int sf_setstate(struct ifmcaddr6 *pmc); static void sf_markstate(struct ifmcaddr6 *pmc); static void ip6_mc_clear_src(struct ifmcaddr6 *pmc); -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev); +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev); #define IGMP6_UNSOLICITED_IVAL (10*HZ) @@ -272,7 +274,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr) return -ENOENT; } -struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) +static struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) { struct net_device *dev = NULL; struct inet6_dev *idev = NULL; @@ -1723,8 +1725,9 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode, return rv; } -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int changerec = 0; @@ -1847,8 +1850,9 @@ static int sf_setstate(struct ifmcaddr6 *pmc) /* * Add multicast source filter list to the interface list */ -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int isexclude; @@ -1951,8 +1955,8 @@ static void igmp6_join_group(struct ifmcaddr6 *ma) spin_unlock_bh(&ma->mca_lock); } -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev) +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev) { int err; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8d3e88c236b3..316644b92cb3 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -208,8 +208,8 @@ static __inline__ struct rt6_info *rt6_device_match(struct rt6_info *rt, /* * pointer to the last default router chosen. BH is disabled locally. */ -struct rt6_info *rt6_dflt_pointer; -DEFINE_SPINLOCK(rt6_dflt_lock); +static struct rt6_info *rt6_dflt_pointer; +static DEFINE_SPINLOCK(rt6_dflt_lock); void rt6_reset_dflt_pointer(struct rt6_info *rt) { diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 9639eaefeb57..3a18e0e6ffed 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c @@ -19,7 +19,7 @@ extern ctl_table ipv6_icmp_table[]; #ifdef CONFIG_SYSCTL -ctl_table ipv6_table[] = { +static ctl_table ipv6_table[] = { { .ctl_name = NET_IPV6_ROUTE, .procname = "route", |
