#include <resolv.h>
#include <stdlib.h>
#include <string.h>
+#include <syslog.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "odhcp6c.h"
static const char hexdigits[] = "0123456789abcdef";
-static const char hexvals[] = {
+static const int8_t hexvals[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -1, -1, -2, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|| y < 0 || (y = hexvals[y]) < 0)
return -1;
dst[c] = x << 4 | y;
- while (*src < 0 || (*src && hexvals[(uint8_t)*src] < 0))
+ while (((int8_t)*src) < 0 ||
+ (*src && hexvals[(uint8_t)*src] < 0))
src++;
}
void script_call(const char *status)
{
+ syslog(LOG_WARNING, "State for %s changed to %s", argv[1], status);
size_t dns_len, search_len, custom_len;
struct in6_addr *dns = odhcp6c_get_state(STATE_DNS, &dns_len);
uint8_t *search = odhcp6c_get_state(STATE_SEARCH, &search_len);