#include "ospfd/ospf_bfd.h"
FRR_CFG_DEFAULT_BOOL(OSPF_LOG_ADJACENCY_CHANGES,
- { .val_long = true, .match_profile = "datacenter", },
- { .val_long = false },
+ { .val_bool = true, .match_profile = "datacenter", },
+ { .val_bool = false },
)
static const char *const ospf_network_type_str[] = {
return 0;
*metric = strtol(str, NULL, 10);
- if (*metric < 0 && *metric > 16777214) {
+ if (*metric < 0 || *metric > 16777214) {
/* vty_out (vty, "OSPF metric value is invalid\n"); */
return 0;
}
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
"%s ospf vrf %s num of %u ip osp area x config",
- __PRETTY_FUNCTION__,
- ospf->name ? ospf->name : "NIL",
+ __func__, ospf->name ? ospf->name : "NIL",
ospf->if_ospf_cli_count);
return CMD_WARNING_CONFIG_FAILED;
}
}
/* Show DR information. */
- if (DR(oi).s_addr == 0) {
+ if (DR(oi).s_addr == INADDR_ANY) {
if (!use_json)
vty_out(vty,
" No backup designated router on this network\n");
}
if (nbr->state == NSM_Attempt
- && nbr->router_id.s_addr == 0)
+ && nbr->router_id.s_addr == INADDR_ANY)
strlcpy(neigh_str, "neighbor",
sizeof(neigh_str));
else
ospf_nbr_state_message(nbr, msgbuf, 16);
if (nbr->state == NSM_Attempt
- && nbr->router_id.s_addr == 0)
+ && nbr->router_id.s_addr == INADDR_ANY)
vty_out(vty, "%-15s %3d %-15s ", "-",
nbr->priority, msgbuf);
else
json_neigh_array = NULL;
}
- if (nbr->state == NSM_Attempt && nbr->router_id.s_addr == 0)
+ if (nbr->state == NSM_Attempt
+ && nbr->router_id.s_addr == INADDR_ANY)
strlcpy(neigh_str, "noNbrId", sizeof(neigh_str));
else
strlcpy(neigh_str, inet_ntoa(nbr->router_id),
} else {
/* Show neighbor ID. */
- if (nbr->state == NSM_Attempt && nbr->router_id.s_addr == 0)
+ if (nbr->state == NSM_Attempt
+ && nbr->router_id.s_addr == INADDR_ANY)
vty_out(vty, " Neighbor %s,", "-");
else
vty_out(vty, " Neighbor %s,",
/* ospfd's interface node. */
-static struct cmd_node interface_node = {INTERFACE_NODE, "%s(config-if)# ", 1};
+static struct cmd_node interface_node = {
+ .node = INTERFACE_NODE,
+ .prompt = "%s(config-if)# ",
+ .vtysh = 1,
+};
/* Initialization of OSPF interface. */
static void ospf_vty_if_init(void)
#endif /* 0 */
}
-static struct cmd_node ospf_node = {OSPF_NODE, "%s(config-router)# ", 1};
+static struct cmd_node ospf_node = {
+ .node = OSPF_NODE,
+ .prompt = "%s(config-router)# ",
+ .vtysh = 1,
+};
static void ospf_interface_clear(struct interface *ifp)
{