Skip to content

Commit

Permalink
report nl errors when nlcfg->surpress_error == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
twpedersen committed Aug 31, 2011
1 parent f81cfcf commit 693fb42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linux/nlutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err,
void *arg)
{
struct netlink_config_s *nlcfg = arg;
struct genlmsghdr *gnlh = nlmsg_data(&err->msg);

if (arg && err && nlcfg->supress_error &&
nlcfg->supress_error != err->error) {
fprintf(stderr, "Unexpected error %d ", err->error);
fprintf(stderr, "(expected %d)\n", nlcfg->supress_error);
} else {
fprintf(stderr, "nlerror, cmd %d, seq %d: %s\n", gnlh->cmd, err->msg.nlmsg_seq,
strerror(abs(err->error)));
}
nlcfg->supress_error = 0;
return NL_SKIP;
Expand Down

0 comments on commit 693fb42

Please sign in to comment.