]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/core/rtnetlink.c
[NETLINK]: Ignore control messages directly in netlink_run_queue()
[net-next-2.6.git] / net / core / rtnetlink.c
index 294c2f209a312f4eb76d513cc32830c92e4ddcb8..b2136accd267ac420a255a36d5c84601e31b26dc 100644 (file)
@@ -122,10 +122,10 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
        struct rtnl_link *tab;
 
        tab = rtnl_msg_handlers[protocol];
-       if (tab == NULL || tab->doit == NULL)
+       if (tab == NULL || tab[msgindex].doit == NULL)
                tab = rtnl_msg_handlers[PF_UNSPEC];
 
-       return tab ? tab->doit : NULL;
+       return tab ? tab[msgindex].doit : NULL;
 }
 
 static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
@@ -133,10 +133,10 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
        struct rtnl_link *tab;
 
        tab = rtnl_msg_handlers[protocol];
-       if (tab == NULL || tab->dumpit == NULL)
+       if (tab == NULL || tab[msgindex].dumpit == NULL)
                tab = rtnl_msg_handlers[PF_UNSPEC];
 
-       return tab ? tab->dumpit : NULL;
+       return tab ? tab[msgindex].dumpit : NULL;
 }
 
 /**
@@ -862,16 +862,8 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
        int type;
        int err;
 
-       /* Only requests are handled by kernel now */
-       if (!(nlh->nlmsg_flags&NLM_F_REQUEST))
-               return 0;
-
        type = nlh->nlmsg_type;
 
-       /* A control message: ignore them */
-       if (type < RTM_BASE)
-               return 0;
-
        /* Unknown message: reply with EINVAL */
        if (type > RTM_MAX)
                goto err_inval;