Date: Sat, 22 Sep 2018 16:30:49 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338890 - head/sbin/ifconfig Message-ID: <201809221630.w8MGUn0I000939@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sat Sep 22 16:30:48 2018 New Revision: 338890 URL: https://svnweb.freebsd.org/changeset/base/338890 Log: 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 Approved by: re (kib) MFC after: 1 week Modified: head/sbin/ifconfig/ifipsec.c Modified: head/sbin/ifconfig/ifipsec.c ============================================================================== --- head/sbin/ifconfig/ifipsec.c Sat Sep 22 16:19:21 2018 (r338889) +++ head/sbin/ifconfig/ifipsec.c Sat Sep 22 16:30:48 2018 (r338890) @@ -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)");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809221630.w8MGUn0I000939>