mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
ospf6d: connected prefix toggle for PtP/PtMP
To announce connected prefixes, or not to announce connected prefixes, that is the question... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
5c0eed0c85
commit
dfe3af42d2
@ -470,6 +470,13 @@ void ospf6_interface_connected_route_update(struct interface *ifp)
|
|||||||
ospf6_route_add(la_route, oi->route_connected);
|
ospf6_route_add(la_route, oi->route_connected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oi->state == OSPF6_INTERFACE_POINTTOMULTIPOINT
|
||||||
|
&& !oi->p2xp_connected_pfx_include)
|
||||||
|
continue;
|
||||||
|
if (oi->state == OSPF6_INTERFACE_POINTTOPOINT
|
||||||
|
&& oi->p2xp_connected_pfx_exclude)
|
||||||
|
continue;
|
||||||
|
|
||||||
struct ospf6_route *route;
|
struct ospf6_route *route;
|
||||||
|
|
||||||
route = ospf6_route_create(oi->area->ospf6);
|
route = ospf6_route_create(oi->area->ospf6);
|
||||||
@ -2716,6 +2723,52 @@ DEFPY (ipv6_ospf6_p2xp_no_multicast_hello,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY (ipv6_ospf6_p2xp_connected_pfx,
|
||||||
|
ipv6_ospf6_p2xp_connected_pfx_cmd,
|
||||||
|
"[no] ipv6 ospf6 p2p-p2mp connected-prefixes <include$incl|exclude$excl>",
|
||||||
|
NO_STR
|
||||||
|
IP6_STR
|
||||||
|
OSPF6_STR
|
||||||
|
"Point-to-point and Point-to-Multipoint parameters\n"
|
||||||
|
"Adjust handling of directly connected prefixes\n"
|
||||||
|
"Advertise prefixes and own /128 (default for PtP)\n"
|
||||||
|
"Ignore, only advertise own /128 (default for PtMP)\n")
|
||||||
|
{
|
||||||
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||||
|
struct ospf6_interface *oi = ifp->info;
|
||||||
|
bool old_incl, old_excl;
|
||||||
|
|
||||||
|
if (no && !oi)
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
|
||||||
|
if (!oi)
|
||||||
|
oi = ospf6_interface_create(ifp);
|
||||||
|
|
||||||
|
old_incl = oi->p2xp_connected_pfx_include;
|
||||||
|
old_excl = oi->p2xp_connected_pfx_exclude;
|
||||||
|
oi->p2xp_connected_pfx_include = false;
|
||||||
|
oi->p2xp_connected_pfx_exclude = false;
|
||||||
|
|
||||||
|
if (incl && !no)
|
||||||
|
oi->p2xp_connected_pfx_include = true;
|
||||||
|
if (excl && !no)
|
||||||
|
oi->p2xp_connected_pfx_exclude = true;
|
||||||
|
|
||||||
|
if (oi->p2xp_connected_pfx_include != old_incl
|
||||||
|
|| oi->p2xp_connected_pfx_exclude != old_excl)
|
||||||
|
ospf6_interface_connected_route_update(ifp);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
ALIAS (ipv6_ospf6_p2xp_connected_pfx,
|
||||||
|
no_ipv6_ospf6_p2xp_connected_pfx_cmd,
|
||||||
|
"no ipv6 ospf6 p2p-p2mp connected-prefixes",
|
||||||
|
NO_STR
|
||||||
|
IP6_STR
|
||||||
|
OSPF6_STR
|
||||||
|
"Point-to-point and Point-to-Multipoint parameters\n"
|
||||||
|
"Adjust handling of directly connected prefixes\n")
|
||||||
|
|
||||||
|
|
||||||
static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf)
|
static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf)
|
||||||
{
|
{
|
||||||
@ -2796,6 +2849,13 @@ static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf)
|
|||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" ipv6 ospf6 p2p-p2mp disable-multicast-hello\n");
|
" ipv6 ospf6 p2p-p2mp disable-multicast-hello\n");
|
||||||
|
|
||||||
|
if (oi->p2xp_connected_pfx_include)
|
||||||
|
vty_out(vty,
|
||||||
|
" ipv6 ospf6 p2p-p2mp connected-prefixes include\n");
|
||||||
|
else if (oi->p2xp_connected_pfx_exclude)
|
||||||
|
vty_out(vty,
|
||||||
|
" ipv6 ospf6 p2p-p2mp connected-prefixes exclude\n");
|
||||||
|
|
||||||
config_write_ospf6_p2xp_neighbor(vty, oi);
|
config_write_ospf6_p2xp_neighbor(vty, oi);
|
||||||
ospf6_bfd_write_config(vty, oi);
|
ospf6_bfd_write_config(vty, oi);
|
||||||
|
|
||||||
@ -2924,6 +2984,8 @@ void ospf6_interface_init(void)
|
|||||||
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,
|
install_element(INTERFACE_NODE,
|
||||||
&ipv6_ospf6_p2xp_no_multicast_hello_cmd);
|
&ipv6_ospf6_p2xp_no_multicast_hello_cmd);
|
||||||
|
install_element(INTERFACE_NODE, &ipv6_ospf6_p2xp_connected_pfx_cmd);
|
||||||
|
install_element(INTERFACE_NODE, &no_ipv6_ospf6_p2xp_connected_pfx_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);
|
||||||
|
@ -74,6 +74,11 @@ struct ospf6_interface {
|
|||||||
bool p2xp_no_multicast_hello;
|
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;
|
||||||
|
/* override mode default for advertising connected prefixes.
|
||||||
|
* both false by default (= do include for PtP, exclude for PtMP)
|
||||||
|
*/
|
||||||
|
bool p2xp_connected_pfx_include;
|
||||||
|
bool p2xp_connected_pfx_exclude;
|
||||||
|
|
||||||
struct ospf6_if_p2xp_neighcfgs_head p2xp_neighs;
|
struct ospf6_if_p2xp_neighcfgs_head p2xp_neighs;
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ clippy_scan += \
|
|||||||
ospf6d/ospf6_lsa.c \
|
ospf6d/ospf6_lsa.c \
|
||||||
ospf6d/ospf6_gr_helper.c \
|
ospf6d/ospf6_gr_helper.c \
|
||||||
ospf6d/ospf6_gr.c \
|
ospf6d/ospf6_gr.c \
|
||||||
|
ospf6d/ospf6_interface.c \
|
||||||
ospf6d/ospf6_nssa.c \
|
ospf6d/ospf6_nssa.c \
|
||||||
ospf6d/ospf6_route.c \
|
ospf6d/ospf6_route.c \
|
||||||
ospf6d/ospf6_neighbor.c \
|
ospf6d/ospf6_neighbor.c \
|
||||||
|
Loading…
Reference in New Issue
Block a user