From 8b97a1fb86b06e329c77c64cdbef29d7738f5840 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 15 Apr 2022 19:10:40 -0500 Subject: [PATCH] Thinko spotted by Elliott: actually compare with variable, not if (constant). --- toys/net/ifconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toys/net/ifconfig.c b/toys/net/ifconfig.c index 818c5932..e9671bb5 100644 --- a/toys/net/ifconfig.c +++ b/toys/net/ifconfig.c @@ -510,8 +510,9 @@ void ifconfig_main(void) if (on < 0) { void *dest = ((on = -on)>>16)+(char *)&ifre; + // If we're about to set mem_start/io_addr/irq, get other 2 first if (off == SIOCSIFMAP) xioctl(TT.sockfd, SIOCGIFMAP, &ifre); - if (SIOCSIFNAME) xstrncpy(dest, *argv, on&0xffff); + if (off == SIOCSIFNAME) xstrncpy(dest, *argv, on&0xffff); else poke(dest, strtoul(*argv, 0, 0), on&15); xioctl(TT.sockfd, off, &ifre); break; -- 2.39.2