summaryrefslogtreecommitdiffstats
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2016-05-02 22:53:38 +0200
committervivek <vivek@cumulusnetworks.com>2016-05-02 22:53:38 +0200
commit4a04e5f7968d46e446bdb530724da18b90b7f5f8 (patch)
tree2fe905811f344992b24d54fc6a81d4ec6ef40567 /lib/zclient.c
parentlib: VRF_GET_ID should respect VRF_UNKNOWN (diff)
downloadfrr-4a04e5f7968d46e446bdb530724da18b90b7f5f8.tar.xz
frr-4a04e5f7968d46e446bdb530724da18b90b7f5f8.zip
BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor
Instead of turning on IPv6 RA on every interface as soon as it has an IPv6 address, only enable it upon configuration of BGP neighbor. When the BGP neighbor is deleted, signal that RAs can be turned off. To support this, introduce new message interaction between BGP and Zebra. Also, take appropriate actions in BGP upon interface add/del since the unnumbered neighbor could exist prior to interface creation etc. Only unnumbered IPv6 neighbors require RA, the /30 or /31 based neighbors don't. However, to keep the interaction simple and not have to deal with too many dynamic conditions (e.g., address deletes or neighbor change to/from 'v6only'), RAs on the interface are triggered upon any unnumbered neighbor configuration. BGP-triggered RAs will cause RAs to be initiated on the interface; however, if BGP asks that RAs be stopped (upon delete of unnumbered neighbor), RAs will continue to be exchanged if the operator has explicitly enabled. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-10640 Reviewed By: CCR-4589 Testing Done: Various manual and automated (refer to defect)
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 1aa1251bf..8cc6bd92a 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -481,6 +481,37 @@ zclient_send_dereg_requests (struct zclient *zclient, vrf_id_t vrf_id)
zebra_message_send (zclient, ZEBRA_REDISTRIBUTE_DEFAULT_DELETE, vrf_id);
}
+/* Send request to zebra daemon to start or stop RA. */
+void
+zclient_send_interface_radv_req (struct zclient *zclient, vrf_id_t vrf_id,
+ struct interface *ifp, int enable)
+{
+ struct stream *s;
+
+ /* zclient is disabled. */
+ if (!zclient->enable)
+ return;
+
+ /* If not connected to the zebra yet. */
+ if (zclient->sock < 0)
+ return;
+
+ /* Form and send message. */
+ s = zclient->obuf;
+ stream_reset (s);
+
+ if (enable)
+ zclient_create_header (s, ZEBRA_INTERFACE_ENABLE_RADV, vrf_id);
+ else
+ zclient_create_header (s, ZEBRA_INTERFACE_DISABLE_RADV, vrf_id);
+
+ stream_putl (s, ifp->ifindex);
+
+ stream_putw_at (s, 0, stream_get_endp (s));
+
+ zclient_send_message(zclient);
+}
+
/* Make connection to zebra daemon. */
int
zclient_start (struct zclient *zclient)