aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
commit15c54033964a943de7b0763efd3bd0ede7326395 (patch)
tree840b292612d1b5396d5bab5bde537a9013db3ceb /net/ipv4/fib_frontend.c
parentad5da3cf39a5b11a198929be1f2644e17ecd767e (diff)
parent912a41a4ab935ce8c4308428ec13fc7f8b1f18f4 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (448 commits) [IPV4] nl_fib_lookup: Initialise res.r before fib_res_put(&res) [IPV6]: Fix thinko in ipv6_rthdr_rcv() changes. [IPV4]: Add multipath cached to feature-removal-schedule.txt [WIRELESS] cfg80211: Clarify locking comment. [WIRELESS] cfg80211: Fix locking in wiphy_new. [WEXT] net_device: Don't include wext bits if not required. [WEXT]: Misc code cleanups. [WEXT]: Reduce inline abuse. [WEXT]: Move EXPORT_SYMBOL statements where they belong. [WEXT]: Cleanup early ioctl call path. [WEXT]: Remove options. [WEXT]: Remove dead debug code. [WEXT]: Clean up how wext is called. [WEXT]: Move to net/wireless [AFS]: Eliminate cmpxchg() usage in vlocation code. [RXRPC]: Fix pointers passed to bitops. [RXRPC]: Remove bogus atomic_* overrides. [AFS]: Fix u64 printing in debug logging. [AFS]: Add "directory write" support. [AFS]: Implement the CB.InitCallBackState3 operation. ...
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index cac06c43f004..837f2957fa83 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -34,7 +34,6 @@
34#include <linux/if_addr.h> 34#include <linux/if_addr.h>
35#include <linux/if_arp.h> 35#include <linux/if_arp.h>
36#include <linux/skbuff.h> 36#include <linux/skbuff.h>
37#include <linux/netlink.h>
38#include <linux/init.h> 37#include <linux/init.h>
39#include <linux/list.h> 38#include <linux/list.h>
40 39
@@ -46,6 +45,7 @@
46#include <net/icmp.h> 45#include <net/icmp.h>
47#include <net/arp.h> 46#include <net/arp.h>
48#include <net/ip_fib.h> 47#include <net/ip_fib.h>
48#include <net/rtnetlink.h>
49 49
50#define FFprint(a...) printk(KERN_DEBUG a) 50#define FFprint(a...) printk(KERN_DEBUG a)
51 51
@@ -540,7 +540,7 @@ errout:
540 return err; 540 return err;
541} 541}
542 542
543int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 543static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
544{ 544{
545 struct fib_config cfg; 545 struct fib_config cfg;
546 struct fib_table *tb; 546 struct fib_table *tb;
@@ -561,7 +561,7 @@ errout:
561 return err; 561 return err;
562} 562}
563 563
564int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 564static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
565{ 565{
566 struct fib_config cfg; 566 struct fib_config cfg;
567 struct fib_table *tb; 567 struct fib_table *tb;
@@ -582,7 +582,7 @@ errout:
582 return err; 582 return err;
583} 583}
584 584
585int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) 585static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
586{ 586{
587 unsigned int h, s_h; 587 unsigned int h, s_h;
588 unsigned int e = 0, s_e; 588 unsigned int e = 0, s_e;
@@ -777,6 +777,10 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb )
777 .tos = frn->fl_tos, 777 .tos = frn->fl_tos,
778 .scope = frn->fl_scope } } }; 778 .scope = frn->fl_scope } } };
779 779
780#ifdef CONFIG_IP_MULTIPLE_TABLES
781 res.r = NULL;
782#endif
783
780 frn->err = -ENOENT; 784 frn->err = -ENOENT;
781 if (tb) { 785 if (tb) {
782 local_bh_disable(); 786 local_bh_disable();
@@ -807,7 +811,7 @@ static void nl_fib_input(struct sock *sk, int len)
807 if (skb == NULL) 811 if (skb == NULL)
808 return; 812 return;
809 813
810 nlh = (struct nlmsghdr *)skb->data; 814 nlh = nlmsg_hdr(skb);
811 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || 815 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
812 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) { 816 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
813 kfree_skb(skb); 817 kfree_skb(skb);
@@ -827,7 +831,8 @@ static void nl_fib_input(struct sock *sk, int len)
827 831
828static void nl_fib_lookup_init(void) 832static void nl_fib_lookup_init(void)
829{ 833{
830 netlink_kernel_create(NETLINK_FIB_LOOKUP, 0, nl_fib_input, THIS_MODULE); 834 netlink_kernel_create(NETLINK_FIB_LOOKUP, 0, nl_fib_input, NULL,
835 THIS_MODULE);
831} 836}
832 837
833static void fib_disable_ip(struct net_device *dev, int force) 838static void fib_disable_ip(struct net_device *dev, int force)
@@ -925,6 +930,10 @@ void __init ip_fib_init(void)
925 register_netdevice_notifier(&fib_netdev_notifier); 930 register_netdevice_notifier(&fib_netdev_notifier);
926 register_inetaddr_notifier(&fib_inetaddr_notifier); 931 register_inetaddr_notifier(&fib_inetaddr_notifier);
927 nl_fib_lookup_init(); 932 nl_fib_lookup_init();
933
934 rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL);
935 rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL);
936 rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib);
928} 937}
929 938
930EXPORT_SYMBOL(inet_addr_type); 939EXPORT_SYMBOL(inet_addr_type);