tcpdump/tests/syslog-v.out
Bram d44f963e59 fix parsing of syslog priority (GH #264)
...the code

* first looks for '<' and advances to the next character,
* it looks for a number between 0 and 9 and advances to the next
  character, (it finds 7)
* it looks for '>' and advances to the next character,
* it looks for a number between 0 and 9 and advances to the next
  character, (it finds the '2' of '2010')

=> result: prio is 72 instead of 7.

The code that checks if the character is '>' should be outside the loop
that checks if the character is a number. The attached patch moves this
check.
2013-09-12 21:14:16 +04:00

17 lines
980 B
Plaintext

IP (tos 0x0, ttl 64, id 30929, offset 0, flags [DF], proto UDP (17), length 79)
10.0.0.20.47565 > 10.0.0.72.514: SYSLOG, length: 51
Facility kernel (0), Severity notice (5)
Msg: Sep 12 19:16:12 through logger: test message 21\0x00
IP (tos 0x0, ttl 64, id 37393, offset 0, flags [DF], proto UDP (17), length 79)
10.0.0.20.33884 > 10.0.0.72.514: SYSLOG, length: 51
Facility user (1), Severity alert (1)
Msg: Sep 12 19:16:18 through logger: test message 22\0x00
IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 107)
10.0.0.20.52693 > 10.0.0.71.514: SYSLOG, length: 79
Facility user (1), Severity notice (5)
Msg: 2013-09-12T19:16:34.457849+04:00 localhost through rsyslog: test message 23
IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 106)
10.0.0.20.52693 > 10.0.0.71.514: SYSLOG, length: 78
Facility user (1), Severity alert (1)
Msg: 2013-09-12T19:16:43.513746+04:00 localhost through rsyslog: test message 24