+// SPDX-License-Identifier: GPL-2.0-or-later
/**
* ospf_bfd.c: OSPF BFD handling routines
*
* @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
struct ospf_if_params *params;
int idx_prof = 4;
- ospf_interface_enable_bfd(ifp);
params = IF_DEF_PARAMS(ifp);
+ if (!params->bfd_config) {
+ vty_out(vty, "ip ospf bfd has not been set\n");
+ return CMD_WARNING;
+ }
+
strlcpy(params->bfd_config->profile, argv[idx_prof]->arg,
sizeof(params->bfd_config->profile));
ospf_interface_bfd_apply(ifp);
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params;
- ospf_interface_enable_bfd(ifp);
params = IF_DEF_PARAMS(ifp);
+ if (!params->bfd_config)
+ return CMD_SUCCESS;
+
params->bfd_config->profile[0] = 0;
ospf_interface_bfd_apply(ifp);