Author: mhorne Date: Wed Aug 12 16:43:20 2020 New Revision: 364172 URL: https://svnweb.freebsd.org/changeset/base/364172
Log: 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 Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Aug 12 16:30:33 2020 (r364171) +++ head/sys/net/route.c Wed Aug 12 16:43:20 2020 (r364172) @@ -1107,7 +1107,11 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin 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); } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"