projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ndp: keep an exact copy of IPv6 interface addresses
[project/odhcpd.git]
/
src
/
odhcpd.c
diff --git
a/src/odhcpd.c
b/src/odhcpd.c
index
ed96178
..
8a18fbf
100644
(file)
--- a/
src/odhcpd.c
+++ b/
src/odhcpd.c
@@
-24,6
+24,7
@@
#include <unistd.h>
#include <signal.h>
#include <stdbool.h>
#include <unistd.h>
#include <signal.h>
#include <stdbool.h>
+#include <syslog.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <net/if.h>
@@
-53,7
+54,6
@@
static int ioctl_sock;
static struct nl_sock *rtnl_socket = NULL;
static int urandom_fd = -1;
static struct nl_sock *rtnl_socket = NULL;
static int urandom_fd = -1;
-
static void sighandler(_unused int signal)
{
uloop_end();
static void sighandler(_unused int signal)
{
uloop_end();
@@
-65,7
+65,7
@@
static void print_usage(const char *app)
"== %s Usage ==\n\n"
" -h, --help Print this help\n"
" -l level Specify log level 0..7 (default %d)\n",
"== %s Usage ==\n\n"
" -h, --help Print this help\n"
" -l level Specify log level 0..7 (default %d)\n",
- app,
LOG_WARNING
+ app,
config.log_level
);
}
);
}
@@
-73,19
+73,19
@@
int main(int argc, char **argv)
{
openlog("odhcpd", LOG_PERROR | LOG_PID, LOG_DAEMON);
int opt;
{
openlog("odhcpd", LOG_PERROR | LOG_PID, LOG_DAEMON);
int opt;
- int log_level = LOG_INFO;
+
while ((opt = getopt(argc, argv, "hl:")) != -1) {
switch (opt) {
case 'h':
print_usage(argv[0]);
return 0;
case 'l':
while ((opt = getopt(argc, argv, "hl:")) != -1) {
switch (opt) {
case 'h':
print_usage(argv[0]);
return 0;
case 'l':
-
log_level = atoi(optarg
);
- fprintf(stderr, "Log level set to %d\n", log_level);
+
config.log_level = (atoi(optarg) & LOG_PRIMASK
);
+ fprintf(stderr, "Log level set to %d\n",
config.
log_level);
break;
}
}
break;
}
}
- setlogmask(LOG_UPTO(log_level));
+ setlogmask(LOG_UPTO(
config.
log_level));
uloop_init();
if (getuid() != 0) {
uloop_init();
if (getuid() != 0) {