rt_newaddrmsg will blow up if given something other than RTM_ADD

or RTM_DELETE; add an assertion, may want to do something more
heavyhanded in the future

Noticed by:	Coverity Prevent analysis tool
Reviewed by:	mdodd
This commit is contained in:
Sam Leffler 2005-03-26 21:49:43 +00:00
parent 2f83086184
commit 7a7fa27b23

View File

@ -861,6 +861,9 @@ rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt)
struct mbuf *m = NULL;
struct ifnet *ifp = ifa->ifa_ifp;
KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE,
("unexpected cmd %u", cmd));
if (route_cb.any_count == 0)
return;
for (pass = 1; pass < 3; pass++) {