summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/zclient.c8
-rw-r--r--lib/zclient.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index a28db083c..0259af597 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -709,6 +709,8 @@ zclient_connect (struct thread *t)
*
* If ZAPI_MESSAGE_TAG is set, the tag value is written as a 2 byte value
*
+ * If ZAPI_MESSAGE_MTU is set, the mtu value is written as a 4 byte value
+ *
* XXX: No attention paid to alignment.
*/
int
@@ -769,6 +771,8 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p,
stream_putl (s, api->metric);
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
stream_putw (s, api->tag);
+ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
+ stream_putl (s, api->mtu);
/* Put length at the first point of the stream. */
stream_putw_at (s, 0, stream_get_endp (s));
@@ -834,6 +838,8 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient,
stream_putl (s, api->metric);
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
stream_putw (s, api->tag);
+ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
+ stream_putl (s, api->mtu);
/* Put length at the first point of the stream. */
stream_putw_at (s, 0, stream_get_endp (s));
@@ -898,6 +904,8 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p,
stream_putl (s, api->metric);
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
stream_putw (s, api->tag);
+ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
+ stream_putl (s, api->mtu);
/* Put length at the first point of the stream. */
stream_putw_at (s, 0, stream_get_endp (s));
diff --git a/lib/zclient.h b/lib/zclient.h
index 8926bbbe6..c42d8c9aa 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -116,6 +116,7 @@ struct zclient
#define ZAPI_MESSAGE_DISTANCE 0x04
#define ZAPI_MESSAGE_METRIC 0x08
#define ZAPI_MESSAGE_TAG 0x10
+#define ZAPI_MESSAGE_MTU 0x20
/* Zserv protocol message header */
struct zserv_header
@@ -154,6 +155,8 @@ struct zapi_ipv4
u_short tag;
+ u_int32_t mtu;
+
vrf_id_t vrf_id;
};
@@ -237,6 +240,8 @@ struct zapi_ipv6
u_short tag;
+ u_int32_t mtu;
+
vrf_id_t vrf_id;
};