X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=misc%2Fnstat.c;h=fc4b03bd66bb10f329eb38db77e3cbeba6ab585f;hb=fcabec0aee42af28e2846ef3674ed7ba7be72c42;hp=f2887ec142fddea948d390aa02fa6a5e9ffc0044;hpb=cb820e861caa85bb3942ab0c673e04b9408be0ad;p=iproute2.git diff --git a/misc/nstat.c b/misc/nstat.c index f2887ec..fc4b03b 100644 --- a/misc/nstat.c +++ b/misc/nstat.c @@ -369,7 +369,7 @@ void update_db(int interval) void server_loop(int fd) { - struct timeval snaptime; + struct timeval snaptime = { 0 }; struct pollfd p; p.fd = fd; p.events = p.revents = POLLIN; @@ -422,7 +422,8 @@ void server_loop(int fd) int verify_forging(int fd) { struct ucred cred; - int olen = sizeof(cred); + socklen_t olen = sizeof(cred); + if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, (void*)&cred, &olen) || olen < sizeof(cred)) return -1;