nhrpd: Fix clang SA about null deref

Clang was complaining when running SA that the nhrpd_privs.change
function was null.  It just does not fully understand how things
are setup.  Add a assert to make it happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2021-02-14 16:04:16 -05:00
parent 0fec6da172
commit 8ca7a3ed38
1 changed files with 7 additions and 2 deletions

View File

@ -144,8 +144,13 @@ int main(int argc, char **argv)
nhrp_interface_init();
resolver_init(master);
/* Run with elevated capabilities, as for all netlink activity
* we need privileges anyway. */
/*
* Run with elevated capabilities, as for all netlink activity
* we need privileges anyway.
* The assert is for clang SA code where it does
* not see the change function being set in lib
*/
assert(nhrpd_privs.change);
nhrpd_privs.change(ZPRIVS_RAISE);
netlink_init();