From: Christian Franke Date: Fri, 16 Sep 2016 19:55:37 +0000 (+0200) Subject: Make route flags a 32bit field X-Git-Tag: frr-2.0-rc1~225 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0fc452dc57467bd1ab1dabe119be979d996af3f9;p=matthieu%2Ffrr.git Make route flags a 32bit field Signed-off-by: Christian Franke --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 0f5c3ce7aa..7089d140b9 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -601,7 +601,7 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv4 prefix. */ @@ -716,7 +716,7 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv6 prefix. */ @@ -1199,7 +1199,7 @@ void bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp, afi_t afi, safi_t safi) { - int flags; + u_int32_t flags; u_char distance; struct peer *peer; struct bgp_info *mpinfo; @@ -1620,7 +1620,7 @@ bgp_zebra_announce_table (struct bgp *bgp, afi_t afi, safi_t safi) void bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi) { - int flags; + u_int32_t flags; struct peer *peer; peer = info->peer; diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index a75e293f96..646c5fa88e 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -257,7 +257,8 @@ static void isis_zebra_route_add_ipv4 (struct prefix *prefix, struct isis_route_info *route_info) { - u_char message, flags; + u_char message; + u_int32_t flags; int psize; struct stream *stream; struct isis_nexthop *nexthop; @@ -285,7 +286,7 @@ isis_zebra_route_add_ipv4 (struct prefix *prefix, /* instance */ stream_putw (stream, 0); /* flags */ - stream_putc (stream, flags); + stream_putl (stream, flags); /* message */ stream_putc (stream, message); /* SAFI */ @@ -566,7 +567,7 @@ isis_zebra_read_ipv4 (int command, struct zclient *zclient, api.type = stream_getc (stream); api.instance = stream_getw (stream); - api.flags = stream_getc (stream); + api.flags = stream_getl (stream); api.message = stream_getc (stream); p.family = AF_INET; @@ -623,7 +624,7 @@ isis_zebra_read_ipv6 (int command, struct zclient *zclient, ifindex = 0; api.type = stream_getc(stream); - api.flags = stream_getc(stream); + api.flags = stream_getl(stream); api.message = stream_getc(stream); p.family = AF_INET6; diff --git a/lib/zclient.c b/lib/zclient.c index 6ccc6e371b..a02cbbe4dd 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -733,7 +733,7 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, /* Put type and nexthop. */ stream_putc (s, api->type); stream_putw (s, api->instance); - stream_putc (s, api->flags); + stream_putl (s, api->flags); stream_putc (s, api->message); stream_putw (s, api->safi); @@ -801,7 +801,7 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient, /* Put type and nexthop. */ stream_putc (s, api->type); stream_putw (s, api->instance); - stream_putc (s, api->flags); + stream_putl (s, api->flags); stream_putc (s, api->message); stream_putw (s, api->safi); @@ -867,7 +867,7 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, /* Put type and nexthop. */ stream_putc (s, api->type); stream_putw (s, api->instance); - stream_putc (s, api->flags); + stream_putl (s, api->flags); stream_putc (s, api->message); stream_putw (s, api->safi); diff --git a/lib/zclient.h b/lib/zclient.h index 231b4e9b4f..4edbd7636e 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -134,7 +134,7 @@ struct zapi_ipv4 u_char type; u_short instance; - u_char flags; + u_int32_t flags; u_char message; @@ -222,7 +222,7 @@ struct zapi_ipv6 u_char type; u_short instance; - u_char flags; + u_int32_t flags; u_char message; diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 5969ef7b69..45165fdf2e 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -229,7 +229,7 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv6 prefix. */ diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 0938ce8d1e..4458e95ba0 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -355,7 +355,7 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or) { u_char message; u_char distance; - u_char flags; + u_int32_t flags; int psize; struct stream *s; struct ospf_path *path; @@ -393,7 +393,7 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or) zclient_create_header (s, ZEBRA_IPV4_ROUTE_ADD, VRF_DEFAULT); stream_putc (s, ZEBRA_ROUTE_OSPF); stream_putw (s, ospf->instance); - stream_putc (s, flags); + stream_putl (s, flags); stream_putc (s, message); stream_putw (s, SAFI_UNICAST); @@ -492,7 +492,7 @@ ospf_zebra_delete (struct prefix_ipv4 *p, struct ospf_route *or) { u_char message; u_char distance; - u_char flags; + u_int32_t flags; int psize; struct stream *s; struct ospf_path *path; @@ -516,7 +516,7 @@ ospf_zebra_delete (struct prefix_ipv4 *p, struct ospf_route *or) zclient_create_header (s, ZEBRA_IPV4_ROUTE_DELETE, VRF_DEFAULT); stream_putc (s, ZEBRA_ROUTE_OSPF); stream_putw (s, ospf->instance); - stream_putc (s, flags); + stream_putl (s, flags); stream_putc (s, message); stream_putw (s, SAFI_UNICAST); @@ -1064,7 +1064,7 @@ ospf_zebra_read_ipv4 (int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv4 prefix. */ diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index b25e8b94da..1a8d5f22bc 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -552,7 +552,7 @@ static int redist_read_ipv4_route(int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc(s); api.instance = stream_getw (s); - api.flags = stream_getc(s); + api.flags = stream_getl(s); api.message = stream_getc(s); /* IPv4 prefix length. */ diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index 06e840464d..ad39f75d68 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -147,7 +147,7 @@ rip_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv4 prefix. */ diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index e1ede095ec..637e8f5a27 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -143,7 +143,7 @@ ripng_zebra_read_ipv6 (int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); /* IPv6 prefix. */ diff --git a/zebra/rib.h b/zebra/rib.h index 0f7f70ada7..285166f067 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -79,7 +79,7 @@ struct rib * This flag's definition is in lib/zebra.h ZEBRA_FLAG_* and is exposed * to clients via Zserv */ - u_char flags; + u_int32_t flags; /* RIB internal status */ u_char status; diff --git a/zebra/zserv.c b/zebra/zserv.c index 8fcc837c53..32c5ea7142 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -629,7 +629,7 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p, /* Put type and nexthop. */ stream_putc (s, rib->type); stream_putw (s, rib->instance); - stream_putc (s, rib->flags); + stream_putl (s, rib->flags); /* marker for message flags field */ messmark = stream_get_endp (s); @@ -1056,7 +1056,7 @@ zread_ipv4_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf) /* Type, flags, message. */ rib->type = stream_getc (s); rib->instance = stream_getw (s); - rib->flags = stream_getc (s); + rib->flags = stream_getl (s); message = stream_getc (s); safi = stream_getw (s); rib->uptime = time (NULL); @@ -1160,7 +1160,7 @@ zread_ipv4_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf) /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); api.safi = stream_getw (s); @@ -1266,7 +1266,7 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length, struct /* Type, flags, message. */ rib->type = stream_getc (s); rib->instance = stream_getw (s); - rib->flags = stream_getc (s); + rib->flags = stream_getl (s); message = stream_getc (s); safi = stream_getw (s); rib->uptime = time (NULL); @@ -1393,7 +1393,7 @@ zread_ipv6_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf) /* Type, flags, message. */ rib->type = stream_getc (s); rib->instance = stream_getw (s); - rib->flags = stream_getc (s); + rib->flags = stream_getl (s); message = stream_getc (s); safi = stream_getw (s); rib->uptime = time (NULL); @@ -1507,7 +1507,7 @@ zread_ipv6_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf) /* Type, flags, message. */ api.type = stream_getc (s); api.instance = stream_getw (s); - api.flags = stream_getc (s); + api.flags = stream_getl (s); api.message = stream_getc (s); api.safi = stream_getw (s);