Correctly set error in rt_mpath_unlink

It is possible for rn_delete() to return NULL. If this happens, then set
*perror to ESRCH, as is done in the rest of the function.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D25871
This commit is contained in:
Mitchell Horne 2020-08-12 16:43:20 +00:00
parent 9eb0cd08ae
commit f7d79f6c6d

View File

@ -1107,7 +1107,11 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info,
rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST],
info->rti_info[RTAX_NETMASK],
&rnh->head);
*perror = 0;
if (rn != NULL) {
*perror = 0;
} else {
*perror = ESRCH;
}
return (rn);
}