[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1452241957-18854-2-git-send-email-lorenzo@google.com>
Date: Fri, 8 Jan 2016 17:32:36 +0900
From: Lorenzo Colitti <lorenzo@...gle.com>
To: netdev@...r.kernel.org
Cc: stephen@...workplumber.org, eric.dumazet@...il.com,
zenczykowski@...il.com, Lorenzo Colitti <lorenzo@...gle.com>
Subject: [iproute PATCH v4 1/2] libnetlink: don't print NETLINK_SOCK_DIAG errors in rtnl_talk
This change is a no-op, as currently no code uses rtnl_talk on
NETLINK_SOCK_DIAG_BY_FAMILY sockets. It is needed to suppress
spurious errors when using SOCK_DESTROY via rtnl_talk.
Signed-off-by: Lorenzo Colitti <lorenzo@...gle.com>
---
lib/libnetlink.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 1658214..d6b5fd3 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -419,8 +419,10 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
return 0;
}
- fprintf(stderr, "RTNETLINK answers: %s\n",
- strerror(-err->error));
+ if (rtnl->proto != NETLINK_SOCK_DIAG)
+ fprintf(stderr,
+ "RTNETLINK answers: %s\n",
+ strerror(-err->error));
errno = -err->error;
return -1;
}
--
2.6.0.rc2.230.g3dd15c0
Powered by blists - more mailing lists