Commit 514f1dc
Florian Westphal
netfilter: nft_ct: enable labels for get case too
conntrack labels can only be set when the conntrack has been created
with the "ctlabel" extension.
For older iptables (connlabel match), adding an "-m connlabel" rule
turns on the ctlabel extension allocation for all future conntrack
entries.
For nftables, its only enabled for 'ct label set foo', but not for
'ct label foo' (i.e. check).
But users could have a ruleset that only checks for presence, and rely
on userspace to set a label bit via ctnetlink infrastructure.
This doesn't work without adding a dummy 'ct label set' rule.
We could also enable extension infra for the first (failing) ctnetlink
request, but unlike ruleset we would not be able to disable the
extension again.
Therefore turn on ctlabel extension allocation if an nftables ruleset
checks for a connlabel too.
Fixes: 1ad8f48 ("netfilter: nftables: add connlabel set support")
Reported-by: Antonio Ojea <[email protected]>
Closes: https://lore.kernel.org/netfilter-devel/[email protected]/
Signed-off-by: Florian Westphal <[email protected]>1 parent 8df206f commit 514f1dc
1 file changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| |||
413 | 421 | | |
414 | 422 | | |
415 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
416 | 428 | | |
417 | 429 | | |
418 | 430 | | |
| |||
494 | 506 | | |
495 | 507 | | |
496 | 508 | | |
497 | | - | |
| 509 | + | |
| 510 | + | |
498 | 511 | | |
499 | 512 | | |
500 | 513 | | |
501 | 514 | | |
502 | 515 | | |
503 | 516 | | |
504 | 517 | | |
505 | | - | |
| 518 | + | |
506 | 519 | | |
507 | 520 | | |
508 | 521 | | |
509 | | - | |
| 522 | + | |
510 | 523 | | |
511 | 524 | | |
512 | 525 | | |
513 | 526 | | |
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
517 | 533 | | |
518 | 534 | | |
519 | 535 | | |
| |||
626 | 642 | | |
627 | 643 | | |
628 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
629 | 648 | | |
630 | 649 | | |
631 | 650 | | |
| |||
0 commit comments