diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nfnetlink.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index a60c59b97631..95fdf04f1d88 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -162,7 +162,7 @@ nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys, | |||
162 | return -EINVAL; | 162 | return -EINVAL; |
163 | } | 163 | } |
164 | 164 | ||
165 | min_len = NLMSG_ALIGN(sizeof(struct nfgenmsg)); | 165 | min_len = NLMSG_SPACE(sizeof(struct nfgenmsg)); |
166 | if (unlikely(nlh->nlmsg_len < min_len)) | 166 | if (unlikely(nlh->nlmsg_len < min_len)) |
167 | return -EINVAL; | 167 | return -EINVAL; |
168 | 168 | ||
@@ -236,8 +236,7 @@ static inline int nfnetlink_rcv_msg(struct sk_buff *skb, | |||
236 | } | 236 | } |
237 | 237 | ||
238 | /* All the messages must at least contain nfgenmsg */ | 238 | /* All the messages must at least contain nfgenmsg */ |
239 | if (nlh->nlmsg_len < | 239 | if (nlh->nlmsg_len < NLMSG_SPACE(sizeof(struct nfgenmsg))) { |
240 | NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) { | ||
241 | DEBUGP("received message was too short\n"); | 240 | DEBUGP("received message was too short\n"); |
242 | return 0; | 241 | return 0; |
243 | } | 242 | } |