mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
uip: rate-limit the dropped-fragment log
uip has no reassembly, so every fragment it receives is discarded and logged. A neighbour that broadcasts fragmented traffic therefore produces a continuous stream of "ip: fragment dropped." rather than an occasional one, at roughly thirteen lines a second on a quiet segment, which buries every other console message. The message carries real information: a sudden burst of it says something about the network. What carries none is repeating it per fragment. Report the count once per five second window instead, which keeps the signal and ends the flood. The count is printed through the no_syslog primitives, as the original message was, so the flood cannot move from the console into the log ring. itoa() writes through write_char(), which also feeds the ring, so it gets a no_syslog twin beside it rather than a private copy of its digits.
This commit is contained in:
1 parent
88454ec7d7
commit
d0374541c5
4 files changed
+35
-1
No files matched your search
@@ -98,7 +98,9 @@ void reset_chip(void) { }
|
||||
void delay(uint16_t t) { (void)t; }
|
||||
void write_char(char c) { (void)c; }
|
||||
void write_char_no_syslog(char c) { (void)c; }
|
||||
void itoa_no_syslog(uint8_t v) { (void)v; }
|
||||
void print_string(const char *p) { (void)p; }
|
||||
void print_string_no_syslog(const char *p) { (void)p; }
|
||||
void print_string_newline_no_syslog(const char *p) { (void)p; }
|
||||
void set_sys_led_state(uint8_t state) { (void)state; }
|
||||
void cmd_parser(void) { }
|
||||
|
||||
Reference in new issue
Block a user