ip/dhcpd: quiet up syslog
the packet prints can be found through -d now.
This commit is contained in:
parent
c12022fd8c
commit
227a46e47d
1 changed files with 7 additions and 15 deletions
|
@ -64,8 +64,6 @@ int mute, mutestat;
|
||||||
int minlease = MinLease;
|
int minlease = MinLease;
|
||||||
int staticlease = StaticLease;
|
int staticlease = StaticLease;
|
||||||
|
|
||||||
uvlong start;
|
|
||||||
|
|
||||||
static int v6opts;
|
static int v6opts;
|
||||||
|
|
||||||
/* option magic */
|
/* option magic */
|
||||||
|
@ -196,15 +194,6 @@ void termopt(Req*);
|
||||||
int validip(uchar*);
|
int validip(uchar*);
|
||||||
void vectoropt(Req*, int, uchar*, int);
|
void vectoropt(Req*, int, uchar*, int);
|
||||||
|
|
||||||
void
|
|
||||||
timestamp(char *tag)
|
|
||||||
{
|
|
||||||
uvlong t;
|
|
||||||
|
|
||||||
t = nsec()/1000;
|
|
||||||
syslog(0, blog, "%s %lludµs", tag, t - start);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
|
@ -317,7 +306,6 @@ main(int argc, char **argv)
|
||||||
n = readlast(r.fd, r.buf, sizeof(r.buf));
|
n = readlast(r.fd, r.buf, sizeof(r.buf));
|
||||||
if(n < Udphdrsize)
|
if(n < Udphdrsize)
|
||||||
fatal("error reading requests: %r");
|
fatal("error reading requests: %r");
|
||||||
start = nsec()/1000;
|
|
||||||
op = optbuf;
|
op = optbuf;
|
||||||
*op = 0;
|
*op = 0;
|
||||||
proto(&r, n);
|
proto(&r, n);
|
||||||
|
@ -409,7 +397,6 @@ proto(Req *rp, int n)
|
||||||
dhcp(rp);
|
dhcp(rp);
|
||||||
else
|
else
|
||||||
bootp(rp);
|
bootp(rp);
|
||||||
timestamp("done");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1689,6 +1676,9 @@ logdhcp(Req *rp)
|
||||||
char *p, *e;
|
char *p, *e;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if(!debug)
|
||||||
|
return;
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
e = buf + sizeof(buf);
|
e = buf + sizeof(buf);
|
||||||
if(rp->dhcptype > 0 && rp->dhcptype <= Inform)
|
if(rp->dhcptype > 0 && rp->dhcptype <= Inform)
|
||||||
|
@ -1718,13 +1708,15 @@ logdhcp(Req *rp)
|
||||||
p = seprint(p, e, ")");
|
p = seprint(p, e, ")");
|
||||||
|
|
||||||
USED(p);
|
USED(p);
|
||||||
syslog(0, blog, "%s", buf);
|
fprint(2, "%s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
logdhcpout(Req *rp, char *type)
|
logdhcpout(Req *rp, char *type)
|
||||||
{
|
{
|
||||||
syslog(0, blog, "%s(%I->%I)id(%s)ci(%V)gi(%V)yi(%V)si(%V) %s",
|
if(!debug)
|
||||||
|
return;
|
||||||
|
fprint(2, "%s(%I->%I)id(%s)ci(%V)gi(%V)yi(%V)si(%V) %s\n",
|
||||||
type, rp->up->laddr, rp->up->raddr, rp->id,
|
type, rp->up->laddr, rp->up->raddr, rp->id,
|
||||||
rp->bp->ciaddr, rp->bp->giaddr, rp->bp->yiaddr, rp->bp->siaddr, optbuf);
|
rp->bp->ciaddr, rp->bp->giaddr, rp->bp->yiaddr, rp->bp->siaddr, optbuf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue