aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 2316a4315a18..81702b9ba5be 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2853,7 +2853,8 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2853 pfx = RTA_DATA(rta[IFA_ADDRESS-1]); 2853 pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
2854 } 2854 }
2855 if (rta[IFA_LOCAL-1]) { 2855 if (rta[IFA_LOCAL-1]) {
2856 if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))) 2856 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
2857 (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
2857 return -EINVAL; 2858 return -EINVAL;
2858 pfx = RTA_DATA(rta[IFA_LOCAL-1]); 2859 pfx = RTA_DATA(rta[IFA_LOCAL-1]);
2859 } 2860 }
@@ -2877,7 +2878,8 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2877 pfx = RTA_DATA(rta[IFA_ADDRESS-1]); 2878 pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
2878 } 2879 }
2879 if (rta[IFA_LOCAL-1]) { 2880 if (rta[IFA_LOCAL-1]) {
2880 if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))) 2881 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
2882 (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
2881 return -EINVAL; 2883 return -EINVAL;
2882 pfx = RTA_DATA(rta[IFA_LOCAL-1]); 2884 pfx = RTA_DATA(rta[IFA_LOCAL-1]);
2883 } 2885 }