summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/rt_netlink.h3
-rw-r--r--zebra/zebra_fpm_netlink.c9
-rw-r--r--zebra/zebra_netns_id.c3
4 files changed, 7 insertions, 10 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 1a090c78e..79d79d74b 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -223,7 +223,7 @@ static inline bool is_selfroute(int proto)
return false;
}
-static inline int zebra2proto(int proto)
+int zebra2proto(int proto)
{
switch (proto) {
case ZEBRA_ROUTE_BABEL:
diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h
index 351f98a2c..8506367ae 100644
--- a/zebra/rt_netlink.h
+++ b/zebra/rt_netlink.h
@@ -150,6 +150,9 @@ const char *ifa_flags2str(uint32_t flags, char *buf, size_t buflen);
const char *nh_flags2str(uint32_t flags, char *buf, size_t buflen);
void nl_dump(void *msg, size_t msglen);
+
+extern int zebra2proto(int proto);
+
#endif /* NETLINK_DEBUG */
#ifdef __cplusplus
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index 628d4a2a8..06c45578a 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -253,14 +253,7 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri,
*/
static uint8_t netlink_proto_from_route_type(int type)
{
- switch (type) {
- case ZEBRA_ROUTE_KERNEL:
- case ZEBRA_ROUTE_CONNECT:
- return RTPROT_KERNEL;
-
- default:
- return RTPROT_ZEBRA;
- }
+ return zebra2proto(type);
}
/*
diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c
index 73d585c1a..8905b72ec 100644
--- a/zebra/zebra_netns_id.c
+++ b/zebra/zebra_netns_id.c
@@ -23,6 +23,7 @@
#include "vrf.h"
#include "log.h"
#include "lib_errors.h"
+#include "network.h"
#include "zebra/rib.h"
#include "zebra/zebra_dplane.h"
@@ -73,7 +74,7 @@ static struct nlmsghdr *initiate_nlh(char *buf, unsigned int *seq, int type)
nlh->nlmsg_flags = NLM_F_REQUEST;
if (type == RTM_NEWNSID)
nlh->nlmsg_flags |= NLM_F_ACK;
- nlh->nlmsg_seq = *seq = time(NULL);
+ nlh->nlmsg_seq = *seq = frr_sequence32_next();
return nlh;
}