Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2018 08:49:47 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r339036 - stable/11/sbin/ifconfig
Message-ID:  <201810010849.w918nlLl049508@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Oct  1 08:49:47 2018
New Revision: 339036
URL: https://svnweb.freebsd.org/changeset/base/339036

Log:
  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

Modified:
  stable/11/sbin/ifconfig/ifipsec.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ifconfig/ifipsec.c
==============================================================================
--- stable/11/sbin/ifconfig/ifipsec.c	Mon Oct  1 07:49:16 2018	(r339035)
+++ stable/11/sbin/ifconfig/ifipsec.c	Mon Oct  1 08:49:47 2018	(r339036)
@@ -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?201810010849.w918nlLl049508>