diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-02-08 09:47:24 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-08 17:28:19 -0500 |
| commit | 3670f5047cb00865c15b2f3ebdfcfe634443db61 (patch) | |
| tree | 3c4030766ff9381f96fdfc859674a9060929402e /zebra/kernel_netlink.c | |
| parent | b564209367385688c7146b00dc5237dde6770660 (diff) | |
zebra: Store the sequence number to use as part of the dp_info
Store and use the sequence number instead of using what is in
the `struct nlsock`. Future commits are going away from storing
the `struct nlsock` and the copy of the nlsock was guaranteeing
unique sequence numbers per message. So let's store the
sequence number to use instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/kernel_netlink.c')
| -rw-r--r-- | zebra/kernel_netlink.c | 14 |
1 files changed, 7 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++; |
