aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJianjun Kong <jianjun@zeuux.org>2008-11-03 03:25:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-03 03:25:16 -0500
commit6ed2533e55889943c478d11b1f63aaed2fd767cc (patch)
treea51dab03a1c92cc229841fb8c758c481c5ac5f3e /net
parent5a5f3a8db9d70c90e9d55b46e02b2d8deb1c2c2e (diff)
net: clean up net/ipv4/fib_frontend.c fib_hash.c ip_gre.c
Signed-off-by: Jianjun Kong <jianjun@zeuux.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/fib_frontend.c10
-rw-r--r--net/ipv4/fib_hash.c12
-rw-r--r--net/ipv4/ip_gre.c14
3 files changed, 18 insertions, 18 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 65c1503f8cc8..741e4fa3e474 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -578,7 +578,7 @@ errout:
578 return err; 578 return err;
579} 579}
580 580
581static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 581static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
582{ 582{
583 struct net *net = sock_net(skb->sk); 583 struct net *net = sock_net(skb->sk);
584 struct fib_config cfg; 584 struct fib_config cfg;
@@ -600,7 +600,7 @@ errout:
600 return err; 600 return err;
601} 601}
602 602
603static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 603static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
604{ 604{
605 struct net *net = sock_net(skb->sk); 605 struct net *net = sock_net(skb->sk);
606 struct fib_config cfg; 606 struct fib_config cfg;
@@ -903,7 +903,7 @@ static void fib_disable_ip(struct net_device *dev, int force)
903 903
904static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr) 904static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
905{ 905{
906 struct in_ifaddr *ifa = (struct in_ifaddr*)ptr; 906 struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
907 struct net_device *dev = ifa->ifa_dev->dev; 907 struct net_device *dev = ifa->ifa_dev->dev;
908 908
909 switch (event) { 909 switch (event) {
@@ -964,11 +964,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
964} 964}
965 965
966static struct notifier_block fib_inetaddr_notifier = { 966static struct notifier_block fib_inetaddr_notifier = {
967 .notifier_call =fib_inetaddr_event, 967 .notifier_call = fib_inetaddr_event,
968}; 968};
969 969
970static struct notifier_block fib_netdev_notifier = { 970static struct notifier_block fib_netdev_notifier = {
971 .notifier_call =fib_netdev_event, 971 .notifier_call = fib_netdev_event,
972}; 972};
973 973
974static int __net_init ip_fib_net_init(struct net *net) 974static int __net_init ip_fib_net_init(struct net *net)
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index c8cac6c7f881..ded8c44fb848 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -247,7 +247,7 @@ fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result
247{ 247{
248 int err; 248 int err;
249 struct fn_zone *fz; 249 struct fn_zone *fz;
250 struct fn_hash *t = (struct fn_hash*)tb->tb_data; 250 struct fn_hash *t = (struct fn_hash *)tb->tb_data;
251 251
252 read_lock(&fib_hash_lock); 252 read_lock(&fib_hash_lock);
253 for (fz = t->fn_zone_list; fz; fz = fz->fz_next) { 253 for (fz = t->fn_zone_list; fz; fz = fz->fz_next) {
@@ -283,7 +283,7 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib
283 struct fib_node *f; 283 struct fib_node *f;
284 struct fib_info *fi = NULL; 284 struct fib_info *fi = NULL;
285 struct fib_info *last_resort; 285 struct fib_info *last_resort;
286 struct fn_hash *t = (struct fn_hash*)tb->tb_data; 286 struct fn_hash *t = (struct fn_hash *)tb->tb_data;
287 struct fn_zone *fz = t->fn_zones[0]; 287 struct fn_zone *fz = t->fn_zones[0];
288 288
289 if (fz == NULL) 289 if (fz == NULL)
@@ -548,7 +548,7 @@ out:
548 548
549static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg) 549static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg)
550{ 550{
551 struct fn_hash *table = (struct fn_hash*)tb->tb_data; 551 struct fn_hash *table = (struct fn_hash *)tb->tb_data;
552 struct fib_node *f; 552 struct fib_node *f;
553 struct fib_alias *fa, *fa_to_delete; 553 struct fib_alias *fa, *fa_to_delete;
554 struct fn_zone *fz; 554 struct fn_zone *fz;
@@ -748,7 +748,7 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
748{ 748{
749 int m, s_m; 749 int m, s_m;
750 struct fn_zone *fz; 750 struct fn_zone *fz;
751 struct fn_hash *table = (struct fn_hash*)tb->tb_data; 751 struct fn_hash *table = (struct fn_hash *)tb->tb_data;
752 752
753 s_m = cb->args[2]; 753 s_m = cb->args[2];
754 read_lock(&fib_hash_lock); 754 read_lock(&fib_hash_lock);
@@ -845,10 +845,10 @@ static struct fib_alias *fib_get_first(struct seq_file *seq)
845 struct hlist_node *node; 845 struct hlist_node *node;
846 struct fib_node *fn; 846 struct fib_node *fn;
847 847
848 hlist_for_each_entry(fn,node,iter->hash_head,fn_hash) { 848 hlist_for_each_entry(fn, node, iter->hash_head, fn_hash) {
849 struct fib_alias *fa; 849 struct fib_alias *fa;
850 850
851 list_for_each_entry(fa,&fn->fn_alias,fa_list) { 851 list_for_each_entry(fa, &fn->fn_alias, fa_list) {
852 iter->fn = fn; 852 iter->fn = fn;
853 iter->fa = fa; 853 iter->fa = fa;
854 goto out; 854 goto out;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 85c487b8572b..191ef7588134 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -371,7 +371,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
371 by themself??? 371 by themself???
372 */ 372 */
373 373
374 struct iphdr *iph = (struct iphdr*)skb->data; 374 struct iphdr *iph = (struct iphdr *)skb->data;
375 __be16 *p = (__be16*)(skb->data+(iph->ihl<<2)); 375 __be16 *p = (__be16*)(skb->data+(iph->ihl<<2));
376 int grehlen = (iph->ihl<<2) + 4; 376 int grehlen = (iph->ihl<<2) + 4;
377 const int type = icmp_hdr(skb)->type; 377 const int type = icmp_hdr(skb)->type;
@@ -632,7 +632,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
632 632
633 if (dev->header_ops && dev->type == ARPHRD_IPGRE) { 633 if (dev->header_ops && dev->type == ARPHRD_IPGRE) {
634 gre_hlen = 0; 634 gre_hlen = 0;
635 tiph = (struct iphdr*)skb->data; 635 tiph = (struct iphdr *)skb->data;
636 } else { 636 } else {
637 gre_hlen = tunnel->hlen; 637 gre_hlen = tunnel->hlen;
638 tiph = &tunnel->parms.iph; 638 tiph = &tunnel->parms.iph;
@@ -660,7 +660,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
660 if (neigh == NULL) 660 if (neigh == NULL)
661 goto tx_error; 661 goto tx_error;
662 662
663 addr6 = (struct in6_addr*)&neigh->primary_key; 663 addr6 = (struct in6_addr *)&neigh->primary_key;
664 addr_type = ipv6_addr_type(addr6); 664 addr_type = ipv6_addr_type(addr6);
665 665
666 if (addr_type == IPV6_ADDR_ANY) { 666 if (addr_type == IPV6_ADDR_ANY) {
@@ -726,7 +726,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
726 } 726 }
727#ifdef CONFIG_IPV6 727#ifdef CONFIG_IPV6
728 else if (skb->protocol == htons(ETH_P_IPV6)) { 728 else if (skb->protocol == htons(ETH_P_IPV6)) {
729 struct rt6_info *rt6 = (struct rt6_info*)skb->dst; 729 struct rt6_info *rt6 = (struct rt6_info *)skb->dst;
730 730
731 if (rt6 && mtu < dst_mtu(skb->dst) && mtu >= IPV6_MIN_MTU) { 731 if (rt6 && mtu < dst_mtu(skb->dst) && mtu >= IPV6_MIN_MTU) {
732 if ((tunnel->parms.iph.daddr && 732 if ((tunnel->parms.iph.daddr &&
@@ -800,7 +800,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
800 iph->ttl = old_iph->ttl; 800 iph->ttl = old_iph->ttl;
801#ifdef CONFIG_IPV6 801#ifdef CONFIG_IPV6
802 else if (skb->protocol == htons(ETH_P_IPV6)) 802 else if (skb->protocol == htons(ETH_P_IPV6))
803 iph->ttl = ((struct ipv6hdr*)old_iph)->hop_limit; 803 iph->ttl = ((struct ipv6hdr *)old_iph)->hop_limit;
804#endif 804#endif
805 else 805 else
806 iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT); 806 iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
@@ -962,7 +962,7 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
962 break; 962 break;
963 } 963 }
964 } else { 964 } else {
965 unsigned nflags=0; 965 unsigned nflags = 0;
966 966
967 t = netdev_priv(dev); 967 t = netdev_priv(dev);
968 968
@@ -1104,7 +1104,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
1104 1104
1105static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr) 1105static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr)
1106{ 1106{
1107 struct iphdr *iph = (struct iphdr*) skb_mac_header(skb); 1107 struct iphdr *iph = (struct iphdr *) skb_mac_header(skb);
1108 memcpy(haddr, &iph->saddr, 4); 1108 memcpy(haddr, &iph->saddr, 4);
1109 return 4; 1109 return 4;
1110} 1110}