From b5686105c3237fe545898b063e34c4fe96de44ac Mon Sep 17 00:00:00 2001 From: ae Date: Mon, 1 Oct 2018 08:49:47 +0000 Subject: [PATCH] MFC r338890: Update ifr_name before invoking IPSECSREQID ioctl, this fixes the case, when `ifconfig ipsec create reqid N` command invoked without interface unit number. The "name" global variable is updated after interface cloning in the ifclonecreate() and contains actual interface name. Reported by: lev --- sbin/ifconfig/ifipsec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ifconfig/ifipsec.c b/sbin/ifconfig/ifipsec.c index fed5a842235..0e615a27e20 100644 --- a/sbin/ifconfig/ifipsec.c +++ b/sbin/ifconfig/ifipsec.c @@ -72,6 +72,7 @@ DECL_CMD_FUNC(setreqid, val, arg) warn("Invalid reqid value %s", val); return; } + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_data = (char *)&v; if (ioctl(s, IPSECSREQID, &ifr) == -1) { warn("ioctl(IPSECSREQID)"); -- 2.45.0