summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2018-02-09 22:52:55 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2018-02-09 22:52:55 +0000
commit1d6f4c6b34f3aeeb9177c36aac417d27a652445e (patch)
treebf0c23e66e361569a741cdda3f7bcf7f7cbeb025
parent188b037f9620ac73109236c2e323ea02aeb9f4e5 (diff)
Style tweaks
ok remi@ benno@
-rw-r--r--usr.sbin/ospfd/ospfd.c9
-rw-r--r--usr.sbin/ospfd/parse.y10
2 files changed, 9 insertions, 10 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 381b35fc600..3c5057ae04e 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -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) {
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index 03d9ca912ab..4bf64d5d7e3 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -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);