*: 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/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 0bbb912..0cd0b77 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -94,7 +94,7 @@
struct bgp_attr_encap_subtlv *encap_subtlvs; /* rfc5512 */
/* route tag */
- u_short tag;
+ route_tag_t tag;
};
/* BGP core attribute structure. */
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index bab9961..78cd53b 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5605,7 +5605,7 @@
void
bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop,
const struct in6_addr *nexthop6,
- u_int32_t metric, u_char type, u_short tag)
+ u_int32_t metric, u_char type, route_tag_t tag)
{
struct bgp *bgp;
struct listnode *node, *nnode;
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 324e006..2a72daa 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -221,7 +221,7 @@
extern void bgp_redistribute_add (struct prefix *, const struct in_addr *,
const struct in6_addr *,
- u_int32_t, u_char, u_short);
+ u_int32_t, u_char, route_tag_t);
extern void bgp_redistribute_delete (struct prefix *, u_char);
extern void bgp_redistribute_withdraw (struct bgp *, afi_t, int);
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 204644a..87f0543 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -1009,7 +1009,7 @@
route_match_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_short *tag;
+ route_tag_t *tag;
struct bgp_info *bgp_info;
if (type == RMAP_BGP)
@@ -1031,8 +1031,8 @@
static void *
route_match_tag_compile (const char *arg)
{
- u_short *tag;
- u_short tmp;
+ route_tag_t *tag;
+ route_tag_t tmp;
/* tag value shoud be integer. */
if (! all_digit (arg))
@@ -1848,7 +1848,7 @@
route_set_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_short *tag;
+ route_tag_t *tag;
struct bgp_info *bgp_info;
struct attr_extra *ae;
@@ -1870,8 +1870,8 @@
static void *
route_set_tag_compile (const char *arg)
{
- u_short *tag;
- u_short tmp;
+ route_tag_t *tag;
+ route_tag_t tmp;
/* tag value shoud be integer. */
if (! all_digit (arg))
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 6c57a6f..38fecd9 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -279,7 +279,7 @@
api.metric = 0;
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
- api.tag = stream_getw (s);
+ api.tag = stream_getl (s);
else
api.tag = 0;
@@ -366,7 +366,7 @@
api.metric = 0;
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
- api.tag = stream_getw (s);
+ api.tag = stream_getl (s);
else
api.tag = 0;
@@ -694,7 +694,7 @@
struct bgp_info *mpinfo;
size_t oldsize, newsize;
u_int32_t nhcount;
- u_short tag = 0;
+ route_tag_t tag = 0;
if (zclient->sock < 0)
return;