diff --git a/include/libnetlink.h b/include/libnetlink.h index bd0267df..c43ab0a2 100644 --- a/include/libnetlink.h +++ b/include/libnetlink.h @@ -21,6 +21,7 @@ struct rtnl_handle { int proto; FILE *dump_fp; #define RTNL_HANDLE_F_LISTEN_ALL_NSID 0x01 +#define RTNL_HANDLE_F_SUPPRESS_NLERR 0x02 int flags; }; diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 9303b668..5b75b2db 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -299,7 +299,8 @@ static void rtnl_dump_error(const struct rtnl_handle *rth, errno == EOPNOTSUPP)) return; - perror("RTNETLINK answers"); + if (!(rth->flags & RTNL_HANDLE_F_SUPPRESS_NLERR)) + perror("RTNETLINK answers"); } }