aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifstf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifstf.c')
-rw-r--r--sbin/ifconfig/ifstf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifstf.c b/sbin/ifconfig/ifstf.c
index 0089cedf7a6b..a99592b4801f 100644
--- a/sbin/ifconfig/ifstf.c
+++ b/sbin/ifconfig/ifstf.c
@@ -54,11 +54,9 @@
static int
do_cmd(if_ctx *ctx, u_long op, void *arg, size_t argsize, int set)
{
- struct ifdrv ifd;
+ struct ifdrv ifd = {};
- memset(&ifd, 0, sizeof(ifd));
-
- strlcpy(ifd.ifd_name, ifr.ifr_name, sizeof(ifd.ifd_name));
+ strlcpy(ifd.ifd_name, ctx->ifname, sizeof(ifd.ifd_name));
ifd.ifd_cmd = op;
ifd.ifd_len = argsize;
ifd.ifd_data = arg;