summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-05-20 13:51:41 +0100
committerRoy Marples <roy@marples.name>2017-05-22 09:50:21 +0100
commitf58a7db77fd3dfec7f0d5c3630ecf906f300e9c1 (patch)
treedb9a3cf9bc03e6cec6f82352d7a791da4ef43fcb /src/dhcpcd.c
parent3cf33877235502a3998fae72d4a1ac657ceb815e (diff)
downloaddhcpcd-f58a7db77fd3dfec7f0d5c3630ecf906f300e9c1.tar.xz
Hardware Address validation
Summary: The all zero's and all one's hardware address are reserved. As such, they should not be used in dhcpcd. Likewise, Router Solicitation messages should not contain an all zero source address option. Fixes T119. Test Plan: Request IPv6RA over a PPP interface on a suitable OS which assigns an all zero's or all one's hardware address. Maniphest Tasks: T119 Differential Revision: https://dev.marples.name/D114
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 91c33948..9c99cb76 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -1074,6 +1074,9 @@ dhcpcd_handlehwaddr(struct dhcpcd_ctx *ctx, const char *ifname,
if (ifp == NULL)
return;
+ if (!if_valid_hwaddr(hwaddr, hwlen))
+ hwlen = 0;
+
if (hwlen > sizeof(ifp->hwaddr)) {
errno = ENOBUFS;
logerr("%s: %s", __func__, ifp->name);