diff --git a/lib/libnetgraph/debug.c b/lib/libnetgraph/debug.c index dfc75f5268e4..9c802956adcd 100644 --- a/lib/libnetgraph/debug.c +++ b/lib/libnetgraph/debug.c @@ -62,13 +62,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -82,15 +85,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -130,13 +138,16 @@ static const struct ng_cookie cookies[] = { COOKIE(ATMLLC), COOKIE(BPF), COOKIE(BRIDGE), + COOKIE(CAR), COOKIE(CISCO), + COOKIE(DEFLATE), COOKIE(DEVICE), COOKIE(ECHO), COOKIE(EIFACE), COOKIE(ETF), COOKIE(ETHER), COOKIE(FEC), + COOKIE(ETHER_ECHO), COOKIE(FRAMERELAY), COOKIE(GIF), COOKIE(GIF_DEMUX), @@ -151,15 +162,20 @@ static const struct ng_cookie cookies[] = { COOKIE(LMI), COOKIE(MPPC), COOKIE(NAT), + COOKIE(NETFLOW), COOKIE(ONE2MANY), + COOKIE(PATCH), + COOKIE(PIPE), COOKIE(PPP), COOKIE(PPPOE), COOKIE(PPTPGRE), + COOKIE(PRED1), COOKIE(RFC1490), COOKIE(SOCKET), COOKIE(SOURCE), COOKIE(SPLIT), COOKIE(SPPP), + COOKIE(TAG), COOKIE(TCPMSS), COOKIE(TEE), COOKIE(TTY), @@ -183,9 +199,8 @@ NgSetDebug(int level) { int old = _gNgDebugLevel; - if (level < 0) - level = old; - _gNgDebugLevel = level; + if (level >= 0) + _gNgDebugLevel = level; return (old); } @@ -227,10 +242,10 @@ _NgDebugMsg(const struct ng_mesg *msg, const char *path) /* Display header stuff */ NGLOGX("NG_MESG :"); NGLOGX(" vers %d", msg->header.version); - NGLOGX(" arglen %d", msg->header.arglen); - NGLOGX(" flags %ld", msg->header.flags); - NGLOGX(" token %lu", (u_long)msg->header.token); - NGLOGX(" cookie %s (%d)", + NGLOGX(" arglen %u", msg->header.arglen); + NGLOGX(" flags %x", msg->header.flags); + NGLOGX(" token %u", msg->header.token); + NGLOGX(" cookie %s (%u)", NgCookie(msg->header.typecookie), msg->header.typecookie); /* At lower debugging levels, skip ASCII translation */