Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2020 16:43:21 +0000 (UTC)
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364172 - head/sys/net
Message-ID:  <202008121643.07CGhLJ7002597@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}
 		



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008121643.07CGhLJ7002597>