odhcpd: fix coding style
[project/odhcpd.git] / src / odhcpd.c
index 5e05977..b1e89b3 100644 (file)
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
 {
        openlog("odhcpd", LOG_PERROR | LOG_PID, LOG_DAEMON);
        int opt;
-       int log_level = LOG_WARNING;
+       int log_level = LOG_INFO;
        while ((opt = getopt(argc, argv, "hl:")) != -1) {
                switch (opt) {
                case 'h':
@@ -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,