smdev

suckless mdev
git clone git://git.2f30.org/smdev
Log | Files | Refs | README | LICENSE

commit 6c9449b688d99e986de1ea9b72e2186f7920c655
parent fd019401f70f21fd167e60135fab7832484e46bb
Author: sin <sin@2f30.org>
Date:   Thu,  4 Sep 2014 15:27:49 +0100

Pop back one indentation level

Diffstat:
Msmdev.c | 29+++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/smdev.c b/smdev.c @@ -399,6 +399,7 @@ populatedev(const char *path) static void ifrename(void) { + struct sockaddr_ll *sa; struct ifaddrs *ifas, *ifa; struct ifreq ifr; int sd; @@ -414,20 +415,20 @@ ifrename(void) for (ifa = ifas; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_flags & IFF_LOOPBACK) continue; - if (ifa->ifa_addr->sa_family == AF_PACKET) { - struct sockaddr_ll *sa = (struct sockaddr_ll *)ifa->ifa_addr; - for (i = 0; mac2names[i].name; i++) { - if (memcmp(mac2names[i].mac, sa->sll_addr, 6) != 0) - continue; - memset(&ifr, 0, sizeof(ifr)); - strlcpy(ifr.ifr_name, - ifa->ifa_name, sizeof(ifr.ifr_name)); - strlcpy(ifr.ifr_newname, - mac2names[i].name, sizeof(ifr.ifr_newname)); - r = ioctl(sd, SIOCSIFNAME, &ifr); - if (r < 0) - eprintf("SIOCSIFNAME:"); - } + if (ifa->ifa_addr->sa_family != AF_PACKET) + continue; + sa = (struct sockaddr_ll *)ifa->ifa_addr; + for (i = 0; mac2names[i].name; i++) { + if (memcmp(mac2names[i].mac, sa->sll_addr, 6) != 0) + continue; + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, + ifa->ifa_name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_newname, + mac2names[i].name, sizeof(ifr.ifr_newname)); + r = ioctl(sd, SIOCSIFNAME, &ifr); + if (r < 0) + eprintf("SIOCSIFNAME:"); } } freeifaddrs(ifas);