Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zebra] bugfix of error quit of zebra, due to no nexthop ACTIVE #7629

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
zebra: bugfix of error quit of zebra, due to no nexthop ACTIVE, refer…
… to ISSUE #7588

Signed-off-by: batmancn <batmanustc@gmail.com>
  • Loading branch information
batmancn authored and gyw committed Dec 1, 2020
commit a83f5d1ef5f0e57afec82519d5809a66caba8339
3 changes: 2 additions & 1 deletion zebra/zebra_fpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,6 @@ static int zfpm_build_route_updates(void)
data_len = zfpm_encode_route(dest, re, (char *)data,
buf_end - data, &msg_type);

assert(data_len);
if (data_len) {
hdr->msg_type = msg_type;
msg_len = fpm_data_len_to_msg_len(data_len);
Expand All @@ -1006,6 +1005,8 @@ static int zfpm_build_route_updates(void)
zfpm_g->stats.route_adds++;
else
zfpm_g->stats.route_dels++;
} else {
zlog_debug("%s: data_len is 0.", __func__);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to guard this debug statement with a conditional check. Alternatively since we're replacing an assert here, this could probably be a zlog_error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zlog_error may be OK. But why guard this zlog_debug statement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By definition, debugging logs print extraneous information that isn't useful to end users, so as a rule we don't print them by default. To get debugs the user has to enable them.

If this is truly an error condition just change the log function to zlog_error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@batmancn if you just change the debug to error we'll get this in. If you need assistance getting the change in let us know.

}
}

Expand Down