Style tweaks
authorjca <jca@openbsd.org>
Fri, 9 Feb 2018 22:52:54 +0000 (22:52 +0000)
committerjca <jca@openbsd.org>
Fri, 9 Feb 2018 22:52:54 +0000 (22:52 +0000)
ok remi@ benno@

usr.sbin/ospfd/ospfd.c
usr.sbin/ospfd/parse.y

index 381b35f..3c5057a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ospfd.c,v 1.95 2018/02/05 12:11:28 remi Exp $ */
+/*     $OpenBSD: ospfd.c,v 1.96 2018/02/09 22:52:54 jca Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -516,13 +516,12 @@ ospf_redistribute(struct kroute *kr, u_int32_t *metric)
        struct in_addr           addr;
        struct kif              *kif;
        struct redistribute     *r;
-       int                      is_default = 0, depend_ok = 1;
+       int                      is_default, depend_ok;
 
        bzero(&addr, sizeof(addr));
 
        /* only allow 0.0.0.0/0 via REDIST_DEFAULT */
-       if (kr->prefix.s_addr == INADDR_ANY && kr->prefixlen == 0)
-               is_default = 1;
+       is_default = (kr->prefix.s_addr == INADDR_ANY && kr->prefixlen == 0);
 
        SIMPLEQ_FOREACH(r, &ospfd_conf->redist_list, entry) {
                if (r->dependon[0] != '\0') {
@@ -530,7 +529,7 @@ ospf_redistribute(struct kroute *kr, u_int32_t *metric)
                                depend_ok = ifstate_is_up(kif);
                        else
                                depend_ok = 0;
-               } else 
+               } else
                        depend_ok = 1;
 
                switch (r->type & ~REDIST_NO) {
index 03d9ca9..4bf64d5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.84 2018/02/05 12:11:28 remi Exp $ */
+/*     $OpenBSD: parse.y,v 1.85 2018/02/09 22:52:54 jca Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -296,9 +296,9 @@ redistribute        : no REDISTRIBUTE NUMBER '/' NUMBER optlist dependon {
                        if ($1)
                                r->type |= REDIST_NO;
                        r->metric = $6;
-                       if ($7) {
+                       if ($7)
                                strlcpy(r->dependon, $7, sizeof(r->dependon));
-                       else
+                       else
                                r->dependon[0] = '\0';
                        free($7);
                        $$ = r;
@@ -326,9 +326,9 @@ redistribute        : no REDISTRIBUTE NUMBER '/' NUMBER optlist dependon {
                        if ($1)
                                r->type |= REDIST_NO;
                        r->metric = $4;
-                       if ($5) {
+                       if ($5)
                                strlcpy(r->dependon, $5, sizeof(r->dependon));
-                       else
+                       else
                                r->dependon[0] = '\0';
                        free($3);
                        free($5);