Commit 73757bc
committed
19852 FIX bgp_peer: tolerate unexpected address byte-list lengths
SNMP devices may return BGP peer address byte-lists whose length is neither
4 (IPv4) nor 16 (IPv6). The bgp_peer parser unconditionally tried to
format such short byte strings as IPv6, which crashed with
AddressValueError: At least 3 parts expected in '7c30' and aborted section
parsing.
_convert_address now renders unexpected byte-list lengths as unknown(...)
so parsing continues for the remaining peers.
Crash-Group-ID: 3608
Jira: CMK-33980
Change-Id: I12cbeb43eba0c9fa1bf1c186f64566d7b563c31d1 parent 5e6caf2 commit 73757bc
3 files changed
Lines changed: 32 additions & 9 deletions
File tree
- .werks
- cmk/plugins/collection/agent_based
- tests/unit/cmk/plugins/collection/agent_based
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
274 | 278 | | |
275 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
276 | 284 | | |
277 | 285 | | |
278 | 286 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 203 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 204 | + | |
211 | 205 | | |
212 | 206 | | |
213 | 207 | | |
| |||
0 commit comments