summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-11-02 15:50:07 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-08-21 19:11:42 +0200
commitc50ca33acf29bb269e8f26be19a8ccd06ab41d3e (patch)
tree82c05cf8767f6b9096a58d57f5fed9bf8c82e8ef /zebra/zserv.c
parentzebra: Fix cherry-pick of ZEBRA_FLAG_CHANGED (diff)
downloadfrr-c50ca33acf29bb269e8f26be19a8ccd06ab41d3e.tar.xz
frr-c50ca33acf29bb269e8f26be19a8ccd06ab41d3e.zip
zebra: implement per-route mtu handling
This commits allow overriding MTU using netlink attributes on per-route basis. This is useful for routing protocols that can advertice prefix specific MTUs between routers (e.g. NHRP). Signed-off-by: Timo Teräs <timo.teras@iki.fi> (cherry picked from commit b11f3b54c842117e22e2f5cf1561ea34eee8dfcc)
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index a1fe9bc18..84881e14a 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -695,6 +695,8 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p,
SET_FLAG(zapi_flags, ZAPI_MESSAGE_TAG);
stream_putw(s, rib->tag);
}
+ SET_FLAG (zapi_flags, ZAPI_MESSAGE_MTU);
+ stream_putl (s, rib->mtu);
}
/* write real message flags value */
@@ -1264,6 +1266,11 @@ zread_ipv4_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
else
rib->tag = 0;
+ if (CHECK_FLAG (message, ZAPI_MESSAGE_MTU))
+ rib->mtu = stream_getl (s);
+ else
+ rib->mtu = 0;
+
/* Table */
rib->table = zvrf->table_id;
@@ -1518,6 +1525,11 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length, struct
else
rib->tag = 0;
+ if (CHECK_FLAG (message, ZAPI_MESSAGE_MTU))
+ rib->mtu = stream_getl (s);
+ else
+ rib->mtu = 0;
+
/* Table */
rib->table = zvrf->table_id;
@@ -1636,6 +1648,11 @@ zread_ipv6_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
else
rib->tag = 0;
+ if (CHECK_FLAG (message, ZAPI_MESSAGE_MTU))
+ rib->mtu = stream_getl (s);
+ else
+ rib->mtu = 0;
+
/* VRF ID */
rib->vrf_id = zvrf->vrf_id;
rib->table = zvrf->table_id;