Commit 56831a5
ipt_netflow: optionally seed initial template ID from PRNG
If we're always starting from 256, a module reload could result in the
client getting data under template IDs that were used under the previous
configuration and might not match (or worse, wrongly match). We add a
compilation option to start the template ID range from a random number,
reducing greatly the chances of such an accident occuring.
Since we're starting from a random number, we now have to check for
wrapping, as the random number might be close to 0xFFFF, which would
mean exporting template with IDs under 256 that are reserved.
v2: Fix the log output by keeping a separate count of the templates
generated by the module.
Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
[abc@openwall.com: Fixed incorrect if statement]
Signed-off-by: ABC <abc@openwall.com>1 parent 83a20ef commit 56831a5
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| |||
704 | 705 | | |
705 | 706 | | |
706 | 707 | | |
707 | | - | |
| 708 | + | |
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
| |||
3393 | 3394 | | |
3394 | 3395 | | |
3395 | 3396 | | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3396 | 3400 | | |
3397 | 3401 | | |
3398 | 3402 | | |
| |||
5710 | 5714 | | |
5711 | 5715 | | |
5712 | 5716 | | |
| 5717 | + | |
| 5718 | + | |
| 5719 | + | |
| 5720 | + | |
5713 | 5721 | | |
5714 | 5722 | | |
5715 | 5723 | | |
| |||
0 commit comments