aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_frontend.c2
-rw-r--r--net/ipv4/inet_diag.c2
-rw-r--r--net/ipv4/netfilter/ip_queue.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index cac06c43f0..3ff753c6f1 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -807,7 +807,7 @@ static void nl_fib_input(struct sock *sk, int len)
807 if (skb == NULL) 807 if (skb == NULL)
808 return; 808 return;
809 809
810 nlh = (struct nlmsghdr *)skb->data; 810 nlh = nlmsg_hdr(skb);
811 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || 811 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
812 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) { 812 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
813 kfree_skb(skb); 813 kfree_skb(skb);
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 37362cd1d0..238999e6e8 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -847,7 +847,7 @@ static inline void inet_diag_rcv_skb(struct sk_buff *skb)
847{ 847{
848 if (skb->len >= NLMSG_SPACE(0)) { 848 if (skb->len >= NLMSG_SPACE(0)) {
849 int err; 849 int err;
850 struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; 850 struct nlmsghdr *nlh = nlmsg_hdr(skb);
851 851
852 if (nlh->nlmsg_len < sizeof(*nlh) || 852 if (nlh->nlmsg_len < sizeof(*nlh) ||
853 skb->len < nlh->nlmsg_len) 853 skb->len < nlh->nlmsg_len)
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 15e0d20022..17f7c98846 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -497,7 +497,7 @@ ipq_rcv_skb(struct sk_buff *skb)
497 if (skblen < sizeof(*nlh)) 497 if (skblen < sizeof(*nlh))
498 return; 498 return;
499 499
500 nlh = (struct nlmsghdr *)skb->data; 500 nlh = nlmsg_hdr(skb);
501 nlmsglen = nlh->nlmsg_len; 501 nlmsglen = nlh->nlmsg_len;
502 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen) 502 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen)
503 return; 503 return;