diff options
| author | Roy Marples <roy@marples.name> | 2008-07-02 09:48:53 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-07-02 09:48:53 +0000 |
| commit | 3aa5b6ed1ad9d02968c9ab1baf1b4f88d3ec5e1c (patch) | |
| tree | 00629ca7389dbc7245012cdbdebc467edf288d18 /net.c | |
| parent | 7896eaf0234c3c6ae260d849ee5a3c7853d9a94e (diff) | |
| download | dhcpcd-3aa5b6ed1ad9d02968c9ab1baf1b4f88d3ec5e1c.tar.xz | |
Fix ClientID parsing.
Diffstat (limited to 'net.c')
| -rw-r--r-- | net.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) |
