summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/lib/py/utils.py
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2024-07-31 23:07:17 +0300
committerDavid S. Miller <davem@davemloft.net>2024-08-04 00:38:44 +0300
commit768e4bb6a75e3c6a034df7c67edac20bd222857e (patch)
treedbf45faf8087ca30a2d44701ecd227122d8f1ec7 /tools/testing/selftests/net/lib/py/utils.py
parent1ad001347fb1ca1f036144b42a6f1df6615e4104 (diff)
downloadlinux-768e4bb6a75e3c6a034df7c67edac20bd222857e.tar.xz
net: Don't register pernet_operations if only one of id or size is specified.
We can allocate per-netns memory for struct pernet_operations by specifying id and size. register_pernet_operations() assigns an id to pernet_operations and later ops_init() allocates the specified size of memory as net->gen->ptr[id]. If id is missing, no memory is allocated. If size is not specified, pernet_operations just wastes an entry of net->gen->ptr[] for every netns. net_generic is available only when both id and size are specified, so let's ensure that. While we are at it, we add const to both fields. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
0 files changed, 0 insertions, 0 deletions