changeset 1684:8d52be1c6cf3

For some reason, ifconfig was explicitly excluding "ifconfig lo:0 127.0.0.2" style alias address assignments. No idea why.
author Rob Landley <rob@landley.net>
date Sun, 08 Feb 2015 16:27:30 -0600
parents f5414b91e639
children 542b55c0f723
files toys/other/ifconfig.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/toys/other/ifconfig.c	Sat Feb 07 19:51:27 2015 -0600
+++ b/toys/other/ifconfig.c	Sun Feb 08 16:27:30 2015 -0600
@@ -462,7 +462,7 @@
       close(fd6);
       continue;
     // Iterate through table to find/perform operation
-    } else for (i = 0; i < sizeof(try)/sizeof(*try); i++) {
+    } else for (i = 0; i < ARRAY_LEN(try); i++) {
       struct argh *t = try+i;
       int on = t->on, off = t->off;
 
@@ -485,7 +485,7 @@
             poke((on>>16) + (char *)&ifre, l, on&15);
             xioctl(TT.sockfd, off, &ifre);
             break;
-          } else if (t->name || !strchr(ifre.ifr_name, ':')) {
+          } else {
             struct sockaddr_in *si = (struct sockaddr_in *)&ifre.ifr_addr;
             int mask = -1;