Revision 574b2324 sysdep/unix/log.c
sysdep/unix/log.c | ||
---|---|---|
180 | 180 |
void |
181 | 181 |
log_rl(struct tbf *f, const char *msg, ...) |
182 | 182 |
{ |
183 |
int last_hit = f->mark; |
|
184 | 183 |
int class = 1; |
185 | 184 |
va_list args; |
186 | 185 |
|
187 | 186 |
/* Rate limiting is a bit tricky here as it also logs '...' during the first hit */ |
188 |
if (tbf_limit(f) && last_hit)
|
|
187 |
if (tbf_limit(f) && (f->drop > 1))
|
|
189 | 188 |
return; |
190 | 189 |
|
191 | 190 |
if (*msg >= 1 && *msg <= 8) |
192 | 191 |
class = *msg++; |
193 | 192 |
|
194 | 193 |
va_start(args, msg); |
195 |
vlog(class, (f->mark ? "..." : msg), args);
|
|
194 |
vlog(class, (f->drop ? "..." : msg), args);
|
|
196 | 195 |
va_end(args); |
197 | 196 |
} |
198 | 197 |
|
... | ... | |
332 | 331 |
mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len) |
333 | 332 |
{ |
334 | 333 |
/* Prepare header */ |
335 |
put_u32(buf+0, now_real);
|
|
334 |
put_u32(buf+0, current_real_time() TO_S);
|
|
336 | 335 |
put_u16(buf+4, type); |
337 | 336 |
put_u16(buf+6, subtype); |
338 | 337 |
put_u32(buf+8, len - MRTDUMP_HDR_LENGTH); |
Also available in: Unified diff