summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/kernel_netlink.c14
-rw-r--r--zebra/zebra_dplane.h3
2 files changed, 10 insertions, 7 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index e3b2f9cb66..5991194548 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -1038,7 +1038,7 @@ netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup),
const struct nlsock *nl;
nl = &(dp_info->nls);
- n->nlmsg_seq = nl->seq;
+ n->nlmsg_seq = dp_info->seq;
n->nlmsg_pid = nl->snl.nl_pid;
if (IS_ZEBRA_DEBUG_KERNEL)
@@ -1172,8 +1172,8 @@ static int nl_batch_read_resp(struct nl_batch *bth)
* 'update' context objects take two consecutive
* sequence numbers.
*/
- if (dplane_ctx_is_update(ctx)
- && dplane_ctx_get_ns(ctx)->nls.seq + 1 == seq) {
+ if (dplane_ctx_is_update(ctx) &&
+ dplane_ctx_get_ns(ctx)->seq + 1 == seq) {
/*
* This is the situation where we get a response
* to a message that should be ignored.
@@ -1186,14 +1186,14 @@ static int nl_batch_read_resp(struct nl_batch *bth)
dplane_ctx_enqueue_tail(bth->ctx_out_q, ctx);
/* We have found corresponding context object. */
- if (dplane_ctx_get_ns(ctx)->nls.seq == seq)
+ if (dplane_ctx_get_ns(ctx)->seq == seq)
break;
- if (dplane_ctx_get_ns(ctx)->nls.seq > seq)
+ if (dplane_ctx_get_ns(ctx)->seq > seq)
zlog_warn(
"%s:WARNING Recieved %u is less than any context on the queue ctx->seq %u",
__func__, seq,
- dplane_ctx_get_ns(ctx)->nls.seq);
+ dplane_ctx_get_ns(ctx)->seq);
}
if (ignore_msg) {
@@ -1360,7 +1360,7 @@ enum netlink_msg_status netlink_batch_add_msg(
return FRR_NETLINK_ERROR;
}
- seq = dplane_ctx_get_ns(ctx)->nls.seq;
+ seq = dplane_ctx_get_ns(ctx)->seq;
if (ignore_res)
seq++;
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h
index 1d55181388..69ea9c7fd9 100644
--- a/zebra/zebra_dplane.h
+++ b/zebra/zebra_dplane.h
@@ -42,6 +42,7 @@ struct zebra_dplane_info {
#if defined(HAVE_NETLINK)
struct nlsock nls;
+ int seq;
bool is_cmd;
#endif
};
@@ -57,8 +58,10 @@ zebra_dplane_info_from_zns(struct zebra_dplane_info *zns_info,
zns_info->is_cmd = is_cmd;
if (is_cmd) {
zns_info->nls = zns->netlink_cmd;
+ zns_info->seq = zns->netlink_cmd.seq;
} else {
zns_info->nls = zns->netlink;
+ zns_info->seq = zns->netlink.seq;
}
#endif /* NETLINK */
}