odhcpd: fix coding style
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 31 Jan 2017 21:07:08 +0000 (22:07 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 31 Jan 2017 21:07:27 +0000 (22:07 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/odhcpd.c

index bf1d496307a1e6b579ed9678fc78727eb7519399..b1e89b3594624bc2373f3fbd561ecf06afb1a8ad 100644 (file)
@@ -292,19 +292,20 @@ out:
 
 int odhcpd_get_linklocal_interface_address(int ifindex, struct in6_addr *lladdr)
 {
-               int status = -1;
-               struct sockaddr_in6 addr = {AF_INET6, 0, 0, ALL_IPV6_ROUTERS, ifindex};
-               socklen_t alen = sizeof(addr);
-               int sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
-
-               if (!connect(sock, (struct sockaddr*)&addr, sizeof(addr)) &&
-                               !getsockname(sock, (struct sockaddr*)&addr, &alen)) {
-                       *lladdr = addr.sin6_addr;
-                       status = 0;
-               }
+       int status = -1;
+       struct sockaddr_in6 addr = {AF_INET6, 0, 0, ALL_IPV6_ROUTERS, ifindex};
+       socklen_t alen = sizeof(addr);
+       int sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
+
+       if (!connect(sock, (struct sockaddr*)&addr, sizeof(addr)) &&
+                       !getsockname(sock, (struct sockaddr*)&addr, &alen)) {
+               *lladdr = addr.sin6_addr;
+               status = 0;
+       }
+
+       close(sock);
 
-               close(sock);
-               return status;
+       return status;
 }
 
 void odhcpd_setup_route(const struct in6_addr *addr, int prefixlen,