*: Widen width of Zserv routing tag field.
* lib/zebra.h: Introduce a route_tag_t type for route tags generally,
and make it 4 bytes wide - so it can directly hold things like an ASN, or
the OSPF ASE-LSA tag.
* zebra/rib.h: Use route_tag_t instead of u_short.
* *: Update 'u_short (*)?(tag|tmp)' to use route_tag_t instead of u_short.
Update stream_{get,put} to l instead of w.
* ospf_zebra.c: (ospf_zebra_add) test OSPF tag within range of ROUTE_TAG_MAX.
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index ce268cd..60d9852 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -370,10 +370,10 @@
if (distance)
SET_FLAG (message, ZAPI_MESSAGE_DISTANCE);
- /* Check if path type is ASE and use only 16bit tags */
+ /* Check if path type is ASE */
if (((or->path_type == OSPF_PATH_TYPE1_EXTERNAL) ||
(or->path_type == OSPF_PATH_TYPE2_EXTERNAL)) &&
- (or->u.ext.tag > 0) && (or->u.ext.tag < UINT16_MAX))
+ (or->u.ext.tag > 0) && (or->u.ext.tag <= ROUTE_TAG_MAX))
SET_FLAG (message, ZAPI_MESSAGE_TAG);
/* Make packet. */
@@ -444,7 +444,7 @@
}
if (CHECK_FLAG (message, ZAPI_MESSAGE_TAG))
- stream_putw (s, (u_short)or->u.ext.tag);
+ stream_putl (s, or->u.ext.tag);
stream_putw_at (s, 0, stream_get_endp (s));
@@ -900,7 +900,7 @@
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
api.metric = stream_getl (s);
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
- api.tag = stream_getw (s);
+ api.tag = stream_getl (s);
else
api.tag = 0;