Commit dcf2dfed authored by Randall Stewart's avatar Randall Stewart
Browse files

tcp: unloading a module that is set to default should error.

I just discovered that the return of the EBUSY error was incorrectly
rigged so that you could unload a CC module that was set to default.
Its supposed to be an EBUSY error. Make it so.

Reviewed by: Michael Tuexen
Sponsored by: Netflix Inc.
Differential Revision:
parent fe96f62d
...@@ -246,14 +246,13 @@ cc_deregister_algo(struct cc_algo *remove_cc) ...@@ -246,14 +246,13 @@ cc_deregister_algo(struct cc_algo *remove_cc)
STAILQ_FOREACH_SAFE(funcs, &cc_list, entries, tmpfuncs) { STAILQ_FOREACH_SAFE(funcs, &cc_list, entries, tmpfuncs) {
if (funcs == remove_cc) { if (funcs == remove_cc) {
if (cc_check_default(remove_cc)) { if (cc_check_default(remove_cc)) {
break; return(EBUSY);
} }
/* Add a temp flag to stop new adds to it */
funcs->flags |= CC_MODULE_BEING_REMOVED;
break; break;
} }
} }
remove_cc->flags |= CC_MODULE_BEING_REMOVED;
err = tcp_ccalgounload(remove_cc); err = tcp_ccalgounload(remove_cc);
/* /*
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment