diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-11-28 17:06:10 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:53:42 +0100 |
commit | 574b2324275d3292e98a8e329f791eb5c799f7f2 (patch) | |
tree | 37f5bcc1edf1bcdcd61380c76fe214afce523bcd /sysdep/unix/log.c | |
parent | 3b3b0910ffb1b212b1c9ea420db6c575a3ecb71a (diff) |
Timers: Fix TBF and some last remains
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r-- | sysdep/unix/log.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index e564f8f2..f9dccc39 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -180,19 +180,18 @@ log_msg(const char *msg, ...) void log_rl(struct tbf *f, const char *msg, ...) { - int last_hit = f->mark; int class = 1; va_list args; /* Rate limiting is a bit tricky here as it also logs '...' during the first hit */ - if (tbf_limit(f) && last_hit) + if (tbf_limit(f) && (f->drop > 1)) return; if (*msg >= 1 && *msg <= 8) class = *msg++; va_start(args, msg); - vlog(class, (f->mark ? "..." : msg), args); + vlog(class, (f->drop ? "..." : msg), args); va_end(args); } @@ -332,7 +331,7 @@ void mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len) { /* Prepare header */ - put_u32(buf+0, now_real); + put_u32(buf+0, current_real_time() TO_S); put_u16(buf+4, type); put_u16(buf+6, subtype); put_u32(buf+8, len - MRTDUMP_HDR_LENGTH); |