Reject attempts to register a TCP stack being unloaded.
Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20617
This commit is contained in:
parent
404e646960
commit
6b69072acc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349474
@ -798,8 +798,12 @@ register_tcp_functions_as_names(struct tcp_function_block *blk, int wait,
|
||||
}
|
||||
}
|
||||
|
||||
if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) {
|
||||
*num_names = 0;
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
refcount_init(&blk->tfb_refcnt, 0);
|
||||
blk->tfb_flags = 0;
|
||||
blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1);
|
||||
for (i = 0; i < *num_names; i++) {
|
||||
n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait);
|
||||
|
Loading…
Reference in New Issue
Block a user