Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9e6d029498ab9e943c70f24c027aeda5602196d
Commit:     d9e6d029498ab9e943c70f24c027aeda5602196d
Parent:     67ca396606432aae3b747d5e6bb61d0c297eb782
Author:     Pablo Neira Ayuso <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 16:41:03 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:25:48 2007 -0700

    [NETFILTER]: nfnetlink: remove duplicate checks in 
nfnetlink_check_attributes
    
    Remove nfnetlink_check_attributes duplicates message size and callback
    id checks. nfnetlink_find_client and nfnetlink_rcv_msg already do
    such checks.
    
    Signed-off-by: Pablo Neira Ayuso <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nfnetlink.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index c8b4f0d..9d33807 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -149,17 +149,10 @@ static int
 nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys,
                           struct nlmsghdr *nlh, struct nfattr *cda[])
 {
-       int min_len;
+       int min_len = NLMSG_SPACE(sizeof(struct nfgenmsg));
        u_int16_t attr_count;
        u_int8_t cb_id = NFNL_MSG_TYPE(nlh->nlmsg_type);
 
-       if (unlikely(cb_id >= subsys->cb_count))
-               return -EINVAL;
-
-       min_len = NLMSG_SPACE(sizeof(struct nfgenmsg));
-       if (unlikely(nlh->nlmsg_len < min_len))
-               return -EINVAL;
-
        attr_count = subsys->cb[cb_id].attr_count;
        memset(cda, 0, sizeof(struct nfattr *) * attr_count);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to