[hackers] [smdev] Pop back one indentation level || sin

From: <git_AT_suckless.org>
Date: Thu, 04 Sep 2014 16:29:19 +0200

commit cae0a45a24450800ffa47e4b8cc2d617fca03106
Author: sin <sin_AT_2f30.org>
Date: Thu Sep 4 15:27:49 2014 +0100

    Pop back one indentation level

diff --git a/smdev.c b/smdev.c
index e5788f5..1c47e25 100644
--- a/smdev.c
+++ b/smdev.c
_AT_@ -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;
_AT_@ -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);
Received on Thu Sep 04 2014 - 16:29:19 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 04 2014 - 16:36:08 CEST