X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fodhcp6c.c;h=3e989a2d39c40031c59585d5b384fe146b37f3dc;hb=78db615ec88b899b047a0f47eb74e9ef0ff5a7fe;hp=645131252a2f9f10c0e19aa136dac61bb6a62855;hpb=9e52c4de4476a99129b4ab2402898dd9af92e86c;p=odhcp6c.git diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 6451312..3e989a2 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -139,13 +139,6 @@ int main(_unused int argc, char* const argv[]) if (help || !ifname) return usage(); - if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 || - init_dhcpv6(ifname, request_pd) || ra_init(ifname) || - script_init(script, ifname)) { - syslog(LOG_ERR, "failed to initialize: %s", strerror(errno)); - return 3; - } - signal(SIGIO, sighandler); signal(SIGHUP, sighandler); signal(SIGINT, sighandler); @@ -154,6 +147,13 @@ int main(_unused int argc, char* const argv[]) signal(SIGUSR1, sighandler); signal(SIGUSR2, sighandler); + if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 || + init_dhcpv6(ifname, request_pd) || ra_init(ifname) || + script_init(script, ifname)) { + syslog(LOG_ERR, "failed to initialize: %s", strerror(errno)); + return 3; + } + if (daemonize) { openlog("odhcp6c", LOG_PID, LOG_DAEMON); // Disable LOG_PERROR if (daemon(0, 0)) { @@ -427,6 +427,7 @@ void odhcp6c_update_entry_safe(enum odhcp6c_state state, struct odhcp6c_entry *n if (x) { x->valid = new->valid; x->preferred = new->preferred; + x->prefix_class = new->prefix_class; } else { odhcp6c_add_state(state, new, sizeof(*new)); }