summaryrefslogtreecommitdiffstats
path: root/net.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-07-02 09:48:53 +0000
committerRoy Marples <roy@marples.name>2008-07-02 09:48:53 +0000
commit3aa5b6ed1ad9d02968c9ab1baf1b4f88d3ec5e1c (patch)
tree00629ca7389dbc7245012cdbdebc467edf288d18 /net.c
parent7896eaf0234c3c6ae260d849ee5a3c7853d9a94e (diff)
downloaddhcpcd-3aa5b6ed1ad9d02968c9ab1baf1b4f88d3ec5e1c.tar.xz
Fix ClientID parsing.
Diffstat (limited to 'net.c')
-rw-r--r--net.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net.c b/net.c
index 3404c9a4..ab5dd27d 100644
--- a/net.c
+++ b/net.c
@@ -148,11 +148,6 @@ hwaddr_aton(unsigned char *buffer, const char *addr)
while (*p) {
c[0] = *p++;
c[1] = *p++;
- /* Ensure that next data is EOL or a seperator with data */
- if (!(*p == '\0' || (*p == ':' && *(p + 1) != '\0'))) {
- errno = EINVAL;
- return 0;
- }
/* Ensure that digits are hex */
if (isxdigit((unsigned char)c[0]) == 0 ||
isxdigit((unsigned char)c[1]) == 0)
@@ -160,6 +155,11 @@ hwaddr_aton(unsigned char *buffer, const char *addr)
errno = EINVAL;
return 0;
}
+ /* Ensure that next data is EOL or a seperator with data */
+ if (!(*p == '\0' || (*p == ':' && *(p + 1) != '\0'))) {
+ errno = EINVAL;
+ return 0;
+ }
if (*p)
p++;
if (bp)