-/* $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>
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') {
depend_ok = ifstate_is_up(kif);
else
depend_ok = 0;
- } else
+ } else
depend_ok = 1;
switch (r->type & ~REDIST_NO) {
-/* $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>
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;
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);