summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-10-15 19:41:30 +0200
committerDonald Sharp <sharpd@nvidia.com>2020-10-29 14:13:59 +0100
commitacde7f6b8e66c58d37501fee0067acc526db03d0 (patch)
tree0248f8a6cda990729d919e3b3b1eaf1cd33b203a
parentMerge pull request #7045 from mjstapp/fix_signals (diff)
downloadfrr-acde7f6b8e66c58d37501fee0067acc526db03d0.tar.xz
frr-acde7f6b8e66c58d37501fee0067acc526db03d0.zip
zebra: Consolidate on 32 bits as the flag size for route flags
When we get a route for installation via any method we should consolidate on 32 bits as the flag size, since we have actually more than 8 bits of data to bass around. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--zebra/kernel_socket.c2
-rw-r--r--zebra/rib.h11
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zebra_rib.c4
4 files changed, 10 insertions, 9 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 8fd0c96bd..9d74aeca2 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -1001,7 +1001,7 @@ static int rtm_read_mesg(struct rt_msghdr *rtm, union sockunion *dest,
void rtm_read(struct rt_msghdr *rtm)
{
int flags;
- uint8_t zebra_flags;
+ uint32_t zebra_flags;
union sockunion dest, mask, gate;
char ifname[INTERFACE_NAMSIZ + 1];
short ifnlen = 0;
diff --git a/zebra/rib.h b/zebra/rib.h
index c02156b37..3bce62bfa 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -366,7 +366,7 @@ extern void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re);
* All rib_add function will not just add prefix into RIB, but
* also implicitly withdraw equal prefix of same type. */
extern int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- unsigned short instance, int flags, struct prefix *p,
+ unsigned short instance, uint32_t flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
uint32_t nhe_id, uint32_t table_id, uint32_t metric,
uint32_t mtu, uint8_t distance, route_tag_t tag);
@@ -382,10 +382,11 @@ extern int rib_add_multipath_nhe(afi_t afi, safi_t safi, struct prefix *p,
struct nhg_hash_entry *nhe);
extern void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- unsigned short instance, int flags, struct prefix *p,
- struct prefix_ipv6 *src_p, const struct nexthop *nh,
- uint32_t nhe_id, uint32_t table_id, uint32_t metric,
- uint8_t distance, bool fromkernel, bool connected_down);
+ unsigned short instance, uint32_t flags,
+ struct prefix *p, struct prefix_ipv6 *src_p,
+ const struct nexthop *nh, uint32_t nhe_id,
+ uint32_t table_id, uint32_t metric, uint8_t distance,
+ bool fromkernel, bool connected_down);
extern struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
union g_addr *addr,
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 19fe7b518..ef51989a0 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -574,7 +574,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
int len;
struct rtmsg *rtm;
struct rtattr *tb[RTA_MAX + 1];
- uint8_t flags = 0;
+ uint32_t flags = 0;
struct prefix p;
struct prefix_ipv6 src_p = {};
vrf_id_t vrf_id;
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 08daddb16..ff19e3f59 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3053,7 +3053,7 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
}
void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- unsigned short instance, int flags, struct prefix *p,
+ unsigned short instance, uint32_t flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
uint32_t nhe_id, uint32_t table_id, uint32_t metric,
uint8_t distance, bool fromkernel, bool connected_down)
@@ -3282,7 +3282,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
- unsigned short instance, int flags, struct prefix *p,
+ unsigned short instance, uint32_t flags, struct prefix *p,
struct prefix_ipv6 *src_p, const struct nexthop *nh,
uint32_t nhe_id, uint32_t table_id, uint32_t metric, uint32_t mtu,
uint8_t distance, route_tag_t tag)