mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 14:35:35 +00:00
Merge remote-tracking branch 'origin/cmaster' into cmaster-next
This commit is contained in:
commit
275382273b
@ -711,7 +711,4 @@ bgp_bfd_init(void)
|
|||||||
install_element (BGP_NODE, &no_neighbor_bfd_cmd);
|
install_element (BGP_NODE, &no_neighbor_bfd_cmd);
|
||||||
install_element (BGP_NODE, &no_neighbor_bfd_val_cmd);
|
install_element (BGP_NODE, &no_neighbor_bfd_val_cmd);
|
||||||
install_element (BGP_NODE, &no_neighbor_bfd_type_cmd);
|
install_element (BGP_NODE, &no_neighbor_bfd_type_cmd);
|
||||||
|
|
||||||
/* Send the client registration */
|
|
||||||
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
|
|||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "lib/json.h"
|
#include "lib/json.h"
|
||||||
|
#include "lib/bfd.h"
|
||||||
|
|
||||||
#include "bgpd/bgpd.h"
|
#include "bgpd/bgpd.h"
|
||||||
#include "bgpd/bgp_route.h"
|
#include "bgpd/bgp_route.h"
|
||||||
@ -43,7 +44,6 @@ Boston, MA 02111-1307, USA. */
|
|||||||
#include "bgpd/bgp_mpath.h"
|
#include "bgpd/bgp_mpath.h"
|
||||||
#include "bgpd/bgp_nexthop.h"
|
#include "bgpd/bgp_nexthop.h"
|
||||||
#include "bgpd/bgp_nht.h"
|
#include "bgpd/bgp_nht.h"
|
||||||
#include "bgpd/bgp_bfd.h"
|
|
||||||
|
|
||||||
/* All information about zebra. */
|
/* All information about zebra. */
|
||||||
struct zclient *zclient = NULL;
|
struct zclient *zclient = NULL;
|
||||||
@ -2057,6 +2057,9 @@ bgp_zebra_connected (struct zclient *zclient)
|
|||||||
|
|
||||||
bgp_zebra_instance_register (bgp);
|
bgp_zebra_instance_register (bgp);
|
||||||
|
|
||||||
|
/* Send the client registration */
|
||||||
|
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
||||||
|
|
||||||
/* TODO - What if we have peers and networks configured, do we have to
|
/* TODO - What if we have peers and networks configured, do we have to
|
||||||
* kick-start them?
|
* kick-start them?
|
||||||
*/
|
*/
|
||||||
|
@ -6630,6 +6630,14 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
|
|||||||
{
|
{
|
||||||
if (peer->afc[afi][safi])
|
if (peer->afc[afi][safi])
|
||||||
{
|
{
|
||||||
|
if ((afi == AFI_IP) && (safi == SAFI_UNICAST))
|
||||||
|
{
|
||||||
|
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
|
||||||
|
{
|
||||||
|
vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
afi_header_vty_out (vty, afi, safi, write,
|
afi_header_vty_out (vty, afi, safi, write,
|
||||||
" neighbor %s activate%s",
|
" neighbor %s activate%s",
|
||||||
addr, VTY_NEWLINE);
|
addr, VTY_NEWLINE);
|
||||||
|
@ -329,6 +329,12 @@ if test $ac_cv_lib_json_c_json_object_get = no; then
|
|||||||
AC_MSG_ERROR([lib json is needed to compile])
|
AC_MSG_ERROR([lib json is needed to compile])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(json-c/json.h)
|
||||||
|
AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c")
|
||||||
|
if test $ac_cv_lib_json_c_json_object_get = no; then
|
||||||
|
AC_MSG_ERROR([lib json is needed to compile])
|
||||||
|
fi
|
||||||
|
|
||||||
if test x"${enable_gcc_rdynamic}" != x"no" ; then
|
if test x"${enable_gcc_rdynamic}" != x"no" ; then
|
||||||
if test x"${enable_gcc_rdynamic}" = x"yes" -o x"$COMPILER" = x"GCC"; then
|
if test x"${enable_gcc_rdynamic}" = x"yes" -o x"$COMPILER" = x"GCC"; then
|
||||||
LDFLAGS="${LDFLAGS} -rdynamic"
|
LDFLAGS="${LDFLAGS} -rdynamic"
|
||||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -39,6 +39,8 @@ override_dh_auto_configure:
|
|||||||
--sysconfdir=/etc/quagga \
|
--sysconfdir=/etc/quagga \
|
||||||
$(USE_SNMP) \
|
$(USE_SNMP) \
|
||||||
--enable-ospfapi=yes \
|
--enable-ospfapi=yes \
|
||||||
|
--enable-vtysh=yes \
|
||||||
|
--enable-isisd=yes \
|
||||||
--enable-multipath=256 \
|
--enable-multipath=256 \
|
||||||
--enable-user=quagga \
|
--enable-user=quagga \
|
||||||
--enable-group=quagga \
|
--enable-group=quagga \
|
||||||
|
@ -420,7 +420,4 @@ ospf6_bfd_init(void)
|
|||||||
install_element (INTERFACE_NODE, &ipv6_ospf6_bfd_cmd);
|
install_element (INTERFACE_NODE, &ipv6_ospf6_bfd_cmd);
|
||||||
install_element (INTERFACE_NODE, &ipv6_ospf6_bfd_param_cmd);
|
install_element (INTERFACE_NODE, &ipv6_ospf6_bfd_param_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_ipv6_ospf6_bfd_cmd);
|
install_element (INTERFACE_NODE, &no_ipv6_ospf6_bfd_cmd);
|
||||||
|
|
||||||
/* Send the client registration */
|
|
||||||
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "zclient.h"
|
#include "zclient.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "lib/bfd.h"
|
||||||
|
|
||||||
#include "ospf6_proto.h"
|
#include "ospf6_proto.h"
|
||||||
#include "ospf6_top.h"
|
#include "ospf6_top.h"
|
||||||
@ -656,6 +657,9 @@ DEFUN (no_redistribute_ospf6,
|
|||||||
static void
|
static void
|
||||||
ospf6_zebra_connected (struct zclient *zclient)
|
ospf6_zebra_connected (struct zclient *zclient)
|
||||||
{
|
{
|
||||||
|
/* Send the client registration */
|
||||||
|
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
||||||
|
|
||||||
zclient_send_reg_requests (zclient, VRF_DEFAULT);
|
zclient_send_reg_requests (zclient, VRF_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +452,4 @@ ospf_bfd_init(void)
|
|||||||
install_element (INTERFACE_NODE, &ip_ospf_bfd_param_cmd);
|
install_element (INTERFACE_NODE, &ip_ospf_bfd_param_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_cmd);
|
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_param_cmd);
|
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_param_cmd);
|
||||||
|
|
||||||
/* Send the client registration */
|
|
||||||
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "plist.h"
|
#include "plist.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "lib/bfd.h"
|
||||||
|
|
||||||
#include "ospfd/ospfd.h"
|
#include "ospfd/ospfd.h"
|
||||||
#include "ospfd/ospf_interface.h"
|
#include "ospfd/ospf_interface.h"
|
||||||
@ -1558,6 +1559,9 @@ ospf_distance_apply (struct prefix_ipv4 *p, struct ospf_route *or)
|
|||||||
static void
|
static void
|
||||||
ospf_zebra_connected (struct zclient *zclient)
|
ospf_zebra_connected (struct zclient *zclient)
|
||||||
{
|
{
|
||||||
|
/* Send the client registration */
|
||||||
|
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
||||||
|
|
||||||
zclient_send_reg_requests (zclient, VRF_DEFAULT);
|
zclient_send_reg_requests (zclient, VRF_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
|
|
||||||
%define daemon_list zebra ripd ospfd bgpd isisd pimd ripngd ospfd6d
|
%define daemon_list zebra ripd ospfd bgpd isisd pimd ripngd ospfd6d
|
||||||
|
|
||||||
|
|
||||||
%if %{with_watchquagga}
|
%if %{with_watchquagga}
|
||||||
%define daemon_watchquagga watchquagga
|
%define daemon_watchquagga watchquagga
|
||||||
%else
|
%else
|
||||||
@ -220,6 +219,7 @@ developing OSPF-API and quagga applications.
|
|||||||
--disable-watchquagga \
|
--disable-watchquagga \
|
||||||
%endif
|
%endif
|
||||||
--enable-gcc-rdynamic \
|
--enable-gcc-rdynamic \
|
||||||
|
--enable-isisd=yes \
|
||||||
--enable-systemd=yes \
|
--enable-systemd=yes \
|
||||||
--enable-poll=yes
|
--enable-poll=yes
|
||||||
|
|
||||||
|
@ -624,13 +624,14 @@ if __name__ == '__main__':
|
|||||||
group.add_argument('--reload', action='store_true', help='Apply the deltas', default=False)
|
group.add_argument('--reload', action='store_true', help='Apply the deltas', default=False)
|
||||||
group.add_argument('--test', action='store_true', help='Show the deltas', default=False)
|
group.add_argument('--test', action='store_true', help='Show the deltas', default=False)
|
||||||
parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False)
|
parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False)
|
||||||
|
parser.add_argument('--stdout', action='store_true', help='Log to STDOUT', default=False)
|
||||||
parser.add_argument('filename', help='Location of new quagga config file')
|
parser.add_argument('filename', help='Location of new quagga config file')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
# For --test log to stdout
|
# For --test log to stdout
|
||||||
# For --reload log to /var/log/quagga/quagga-reload.log
|
# For --reload log to /var/log/quagga/quagga-reload.log
|
||||||
if args.test:
|
if args.test or args.stdout:
|
||||||
logging.basicConfig(level=logging.INFO,
|
logging.basicConfig(level=logging.INFO,
|
||||||
format='%(asctime)s %(levelname)5s: %(message)s')
|
format='%(asctime)s %(levelname)5s: %(message)s')
|
||||||
elif args.reload:
|
elif args.reload:
|
||||||
|
@ -131,11 +131,13 @@ zebra_ptm_init (void)
|
|||||||
void
|
void
|
||||||
zebra_ptm_finish(void)
|
zebra_ptm_finish(void)
|
||||||
{
|
{
|
||||||
if (ptm_cb.ptm_sock != -1)
|
int proto;
|
||||||
close(ptm_cb.ptm_sock);
|
|
||||||
|
|
||||||
if (ptm_cb.wb)
|
for (proto = 0; proto < ZEBRA_ROUTE_MAX; proto++)
|
||||||
buffer_free(ptm_cb.wb);
|
if (CHECK_FLAG(ptm_cb.client_flags[proto], ZEBRA_PTM_BFD_CLIENT_FLAG_REG))
|
||||||
|
zebra_ptm_bfd_client_deregister(proto);
|
||||||
|
|
||||||
|
buffer_flush_all(ptm_cb.wb, ptm_cb.ptm_sock);
|
||||||
|
|
||||||
if (ptm_cb.out_data)
|
if (ptm_cb.out_data)
|
||||||
free(ptm_cb.out_data);
|
free(ptm_cb.out_data);
|
||||||
@ -150,6 +152,12 @@ zebra_ptm_finish(void)
|
|||||||
thread_cancel (ptm_cb.t_write);
|
thread_cancel (ptm_cb.t_write);
|
||||||
if (ptm_cb.t_timer)
|
if (ptm_cb.t_timer)
|
||||||
thread_cancel (ptm_cb.t_timer);
|
thread_cancel (ptm_cb.t_timer);
|
||||||
|
|
||||||
|
if (ptm_cb.wb)
|
||||||
|
buffer_free(ptm_cb.wb);
|
||||||
|
|
||||||
|
if (ptm_cb.ptm_sock != -1)
|
||||||
|
close(ptm_cb.ptm_sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -999,24 +1007,26 @@ zebra_ptm_bfd_client_register (struct zserv *client, int sock, u_short length)
|
|||||||
zlog_debug ("%s: Sent message (%d) %s", __func__, data_len,
|
zlog_debug ("%s: Sent message (%d) %s", __func__, data_len,
|
||||||
ptm_cb.out_data);
|
ptm_cb.out_data);
|
||||||
zebra_ptm_send_message(ptm_cb.out_data, data_len);
|
zebra_ptm_send_message(ptm_cb.out_data, data_len);
|
||||||
|
|
||||||
|
SET_FLAG(ptm_cb.client_flags[client->proto], ZEBRA_PTM_BFD_CLIENT_FLAG_REG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BFD client deregister */
|
/* BFD client deregister */
|
||||||
void
|
void
|
||||||
zebra_ptm_bfd_client_deregister (struct zserv *client)
|
zebra_ptm_bfd_client_deregister (int proto)
|
||||||
{
|
{
|
||||||
void *out_ctxt;
|
void *out_ctxt;
|
||||||
char tmp_buf[64];
|
char tmp_buf[64];
|
||||||
int data_len = ZEBRA_PTM_SEND_MAX_SOCKBUF;
|
int data_len = ZEBRA_PTM_SEND_MAX_SOCKBUF;
|
||||||
|
|
||||||
if (client->proto != ZEBRA_ROUTE_OSPF && client->proto != ZEBRA_ROUTE_BGP
|
if (proto != ZEBRA_ROUTE_OSPF && proto != ZEBRA_ROUTE_BGP
|
||||||
&& client->proto != ZEBRA_ROUTE_OSPF6)
|
&& proto != ZEBRA_ROUTE_OSPF6)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_EVENT)
|
if (IS_ZEBRA_DEBUG_EVENT)
|
||||||
zlog_debug("bfd_client_deregister msg for client %s",
|
zlog_err("bfd_client_deregister msg for client %s",
|
||||||
zebra_route_string(client->proto));
|
zebra_route_string(proto));
|
||||||
|
|
||||||
if (ptm_cb.ptm_sock == -1)
|
if (ptm_cb.ptm_sock == -1)
|
||||||
{
|
{
|
||||||
@ -1030,7 +1040,7 @@ zebra_ptm_bfd_client_deregister (struct zserv *client)
|
|||||||
sprintf(tmp_buf, "%s", ZEBRA_PTM_BFD_CLIENT_DEREG_CMD);
|
sprintf(tmp_buf, "%s", ZEBRA_PTM_BFD_CLIENT_DEREG_CMD);
|
||||||
ptm_lib_append_msg(ptm_hdl, out_ctxt, ZEBRA_PTM_CMD_STR, tmp_buf);
|
ptm_lib_append_msg(ptm_hdl, out_ctxt, ZEBRA_PTM_CMD_STR, tmp_buf);
|
||||||
|
|
||||||
sprintf(tmp_buf, "%s", zebra_route_string(client->proto));
|
sprintf(tmp_buf, "%s", zebra_route_string(proto));
|
||||||
ptm_lib_append_msg(ptm_hdl, out_ctxt, ZEBRA_PTM_BFD_CLIENT_FIELD,
|
ptm_lib_append_msg(ptm_hdl, out_ctxt, ZEBRA_PTM_BFD_CLIENT_FIELD,
|
||||||
tmp_buf);
|
tmp_buf);
|
||||||
|
|
||||||
@ -1039,7 +1049,9 @@ zebra_ptm_bfd_client_deregister (struct zserv *client)
|
|||||||
if (IS_ZEBRA_DEBUG_SEND)
|
if (IS_ZEBRA_DEBUG_SEND)
|
||||||
zlog_debug ("%s: Sent message (%d) %s", __func__, data_len,
|
zlog_debug ("%s: Sent message (%d) %s", __func__, data_len,
|
||||||
ptm_cb.out_data);
|
ptm_cb.out_data);
|
||||||
|
|
||||||
zebra_ptm_send_message(ptm_cb.out_data, data_len);
|
zebra_ptm_send_message(ptm_cb.out_data, data_len);
|
||||||
|
UNSET_FLAG(ptm_cb.client_flags[proto], ZEBRA_PTM_BFD_CLIENT_FLAG_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -27,6 +27,8 @@ extern const char ZEBRA_PTM_SOCK_NAME[];
|
|||||||
#define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
|
#define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
|
||||||
#define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
|
#define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
|
||||||
|
|
||||||
|
#define ZEBRA_PTM_BFD_CLIENT_FLAG_REG (1 << 1) /* client registered with BFD */
|
||||||
|
|
||||||
/* Zebra ptm context block */
|
/* Zebra ptm context block */
|
||||||
struct zebra_ptm_cb
|
struct zebra_ptm_cb
|
||||||
{
|
{
|
||||||
@ -44,6 +46,7 @@ struct zebra_ptm_cb
|
|||||||
|
|
||||||
int ptm_enable;
|
int ptm_enable;
|
||||||
int pid;
|
int pid;
|
||||||
|
u_int8_t client_flags[ZEBRA_ROUTE_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ZEBRA_PTM_STATUS_DOWN 0
|
#define ZEBRA_PTM_STATUS_DOWN 0
|
||||||
@ -72,5 +75,5 @@ int zebra_ptm_bfd_client_register (struct zserv *client, int sock,
|
|||||||
void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
|
void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
|
||||||
void zebra_ptm_if_set_ptm_state(struct interface *ifp, struct zebra_if *zebra_ifp);
|
void zebra_ptm_if_set_ptm_state(struct interface *ifp, struct zebra_if *zebra_ifp);
|
||||||
void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp);
|
void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp);
|
||||||
void zebra_ptm_bfd_client_deregister (struct zserv *client);
|
void zebra_ptm_bfd_client_deregister (int proto);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1832,7 +1832,7 @@ static void
|
|||||||
zebra_client_close (struct zserv *client)
|
zebra_client_close (struct zserv *client)
|
||||||
{
|
{
|
||||||
/* Send client de-registration to BFD */
|
/* Send client de-registration to BFD */
|
||||||
zebra_ptm_bfd_client_deregister(client);
|
zebra_ptm_bfd_client_deregister(client->proto);
|
||||||
|
|
||||||
/* Cleanup any registered nexthops - across all VRFs. */
|
/* Cleanup any registered nexthops - across all VRFs. */
|
||||||
zebra_client_close_cleanup_rnh (client);
|
zebra_client_close_cleanup_rnh (client);
|
||||||
|
Loading…
Reference in New Issue
Block a user