Commit 6d07a28
netfilter: nf_tables: Support wildcard netdev hook specs
User space may pass non-nul-terminated NFTA_DEVICE_NAME attribute values
to indicate a suffix wildcard.
Expect for multiple devices to match the given prefix in
nft_netdev_hook_alloc() and populate 'ops_list' with them all.
When checking for duplicate hooks, compare the shortest prefix so a
device may never match more than a single hook spec.
Finally respect the stored prefix length when hooking into new devices
from event handlers.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>1 parent 6f67093 commit 6d07a28
2 files changed
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2330 | 2330 | | |
2331 | 2331 | | |
2332 | 2332 | | |
2333 | | - | |
2334 | | - | |
2335 | | - | |
2336 | | - | |
2337 | | - | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
2338 | 2336 | | |
2339 | | - | |
2340 | | - | |
2341 | | - | |
2342 | | - | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
2343 | 2344 | | |
2344 | | - | |
2345 | | - | |
2346 | | - | |
2347 | 2345 | | |
2348 | 2346 | | |
2349 | 2347 | | |
2350 | | - | |
| 2348 | + | |
2351 | 2349 | | |
2352 | 2350 | | |
2353 | 2351 | | |
| |||
2357 | 2355 | | |
2358 | 2356 | | |
2359 | 2357 | | |
2360 | | - | |
| 2358 | + | |
| 2359 | + | |
2361 | 2360 | | |
2362 | 2361 | | |
2363 | 2362 | | |
| |||
9696 | 9695 | | |
9697 | 9696 | | |
9698 | 9697 | | |
9699 | | - | |
| 9698 | + | |
9700 | 9699 | | |
9701 | 9700 | | |
9702 | 9701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
0 commit comments