ospf6d: option to disable multicast hellos

With the configured neighbor list, unicast hellos can be sent.  Allow
disabling multicast hellos for that scenario.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2021-07-27 16:12:04 +02:00 committed by Adriano Marto Reis
parent f5917bae53
commit 3d1482a945
3 changed files with 42 additions and 4 deletions

View File

@ -2673,6 +2673,33 @@ DEFPY (ipv6_ospf6_p2xp_only_cfg_neigh,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFPY (ipv6_ospf6_p2xp_no_multicast_hello,
ipv6_ospf6_p2xp_no_multicast_hello_cmd,
"[no] ipv6 ospf6 p2p-p2mp disable-multicast-hello",
NO_STR
IP6_STR
OSPF6_STR
"Point-to-point and Point-to-Multipoint parameters\n"
"Do not send multicast hellos\n")
{
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi = ifp->info;
if (no) {
if (!oi)
return CMD_SUCCESS;
oi->p2xp_no_multicast_hello = false;
return CMD_SUCCESS;
}
if (!oi)
oi = ospf6_interface_create(ifp);
oi->p2xp_no_multicast_hello = true;
return CMD_SUCCESS;
}
static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf) static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf)
{ {
@ -2746,6 +2773,10 @@ static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf)
vty_out(vty, vty_out(vty,
" ipv6 ospf6 p2p-p2mp config-neighbors-only\n"); " ipv6 ospf6 p2p-p2mp config-neighbors-only\n");
if (oi->p2xp_no_multicast_hello)
vty_out(vty,
" ipv6 ospf6 p2p-p2mp disable-multicast-hello\n");
ospf6_bfd_write_config(vty, oi); ospf6_bfd_write_config(vty, oi);
ospf6_auth_write_config(vty, &oi->at_data); ospf6_auth_write_config(vty, &oi->at_data);
@ -2871,6 +2902,8 @@ void ospf6_interface_init(void)
install_element(INTERFACE_NODE, &no_ipv6_ospf6_network_cmd); install_element(INTERFACE_NODE, &no_ipv6_ospf6_network_cmd);
install_element(INTERFACE_NODE, &ipv6_ospf6_p2xp_only_cfg_neigh_cmd); install_element(INTERFACE_NODE, &ipv6_ospf6_p2xp_only_cfg_neigh_cmd);
install_element(INTERFACE_NODE,
&ipv6_ospf6_p2xp_no_multicast_hello_cmd);
/* reference bandwidth commands */ /* reference bandwidth commands */
install_element(OSPF6_NODE, &auto_cost_reference_bandwidth_cmd); install_element(OSPF6_NODE, &auto_cost_reference_bandwidth_cmd);

View File

@ -70,6 +70,8 @@ struct ospf6_interface {
/* P2P/P2MP behavior: */ /* P2P/P2MP behavior: */
/* disable hellos on standard multicast? */
bool p2xp_no_multicast_hello;
/* only allow explicitly configured neighbors? */ /* only allow explicitly configured neighbors? */
bool p2xp_only_cfg_neigh; bool p2xp_only_cfg_neigh;

View File

@ -2284,6 +2284,13 @@ void ospf6_hello_send(struct event *thread)
return; return;
} }
event_add_timer(master, ospf6_hello_send, oi, oi->hello_interval,
&oi->thread_send_hello);
if (oi->state == OSPF6_INTERFACE_POINTTOPOINT
&& oi->p2xp_no_multicast_hello)
return 0;
op = ospf6_packet_new(oi->ifmtu); op = ospf6_packet_new(oi->ifmtu);
ospf6_make_header(OSPF6_MESSAGE_TYPE_HELLO, oi, op->s); ospf6_make_header(OSPF6_MESSAGE_TYPE_HELLO, oi, op->s);
@ -2311,10 +2318,6 @@ void ospf6_hello_send(struct event *thread)
*/ */
ospf6_packet_add_top(oi, op); ospf6_packet_add_top(oi, op);
/* set next thread */
event_add_timer(master, ospf6_hello_send, oi, oi->hello_interval,
&oi->thread_send_hello);
OSPF6_MESSAGE_WRITE_ON(oi); OSPF6_MESSAGE_WRITE_ON(oi);
} }