@@ -23,6 +23,7 @@ struct rtnl_handle {
FILE *dump_fp;
#define RTNL_HANDLE_F_LISTEN_ALL_NSID 0x01
#define RTNL_HANDLE_F_SUPPRESS_NLERR 0x02
+#define RTNL_HANDLE_F_STRICT_CHK 0x04
int flags;
};
@@ -166,8 +166,11 @@ void rtnl_set_strict_dump(struct rtnl_handle *rth)
{
int one = 1;
- setsockopt(rth->fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK,
- &one, sizeof(one));
+ if (setsockopt(rth->fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK,
+ &one, sizeof(one)) < 0)
+ return;
+
+ rth->flags |= RTNL_HANDLE_F_STRICT_CHK;
}
void rtnl_close(struct rtnl_handle *rth)