aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2022-04-15 19:10:40 -0500
committerRob Landley <rob@landley.net>2022-04-15 19:10:40 -0500
commit8b97a1fb86b06e329c77c64cdbef29d7738f5840 (patch)
tree80440375653dc63e9ee3f95e2984819152eaa134
parent9798b6066986391a606051c3bf0fe45dbfb4e30f (diff)
downloadtoybox-8b97a1fb86b06e329c77c64cdbef29d7738f5840.tar.gz
Thinko spotted by Elliott: actually compare with variable, not if (constant).
-rw-r--r--toys/net/ifconfig.c3
1 files changed, 2 insertions, 1 deletions
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;