summaryrefslogtreecommitdiffstats
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:45 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:45 +0200
commit8bb0831e232336a9d966920901216fa2098ea48a (patch)
treef3e045ec5e536cd845760399d96a70705c4818f8 /lib/zclient.h
parentBGP: add addpath RX support (diff)
downloadfrr-8bb0831e232336a9d966920901216fa2098ea48a.tar.xz
frr-8bb0831e232336a9d966920901216fa2098ea48a.zip
Per AFI redist registrations
The problem is that zclient->redist[ZEBRA_ROUTE_MAX] used for storing a client’s redist state, has no address-family qualification. This means a client can only store its interest in a protocol (connected, static etc.), but cant choose IPv4 or ipv6 with that. This hindered implementation on client sides to manage redistribution of ipv4 and ipv6 both. BGP's redistribution of protocols like connected/static is one such place. One fix could be to overload this and flap the redist connection each time any new afi is added for redist, but that may have side-effects on the existing afi redist. The cleaner way is to modify redist data-structure to also take AFI, and adjust routines that deal with it, so that a client can register for a protocol redistribution based on the AFI. BGP already maintains redistribution state based on afi and protocol (bgp->redist[AFI_MAX][ZEBRA_ROUTE_MAX]). This patch takes care of filling up the gap in zclient/zserv redistribution state to also use AFI qualification. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 3c214d278..f73145db0 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -72,7 +72,7 @@ struct zclient
/* Redistribute information. */
u_char redist_default; /* clients protocol */
u_short instance;
- struct redist_proto redist[ZEBRA_ROUTE_MAX];
+ struct redist_proto redist[AFI_MAX][ZEBRA_ROUTE_MAX];
/* Redistribute defauilt. */
u_char default_information;
@@ -156,10 +156,10 @@ extern void redist_add_instance (struct redist_proto *, u_short);
extern void redist_del_instance (struct redist_proto *, u_short);
/* Send redistribute command to zebra daemon. Do not update zclient state. */
-extern int zebra_redistribute_send (int command, struct zclient *, int type, u_short instance);
+extern int zebra_redistribute_send (int command, struct zclient *, afi_t, int type, u_short instance);
/* If state has changed, update state and call zebra_redistribute_send. */
-extern void zclient_redistribute (int command, struct zclient *, int type,
+extern void zclient_redistribute (int command, struct zclient *, afi_t, int type,
u_short instance);
/* If state has changed, update state and send the command to zebra. */