- fix typ0 in message: NLSMG -> NLMSG
- use strerror() to print a human readable message
- don't print error message if error is ENETUNREACH: it means no route
found
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
20170720082338.1302-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15101.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
if (nh->nlmsg_type == NLMSG_ERROR)
{
struct nlmsgerr *ne = (struct nlmsgerr *)NLMSG_DATA(nh);
- msg(M_WARN, "GDG6: NLSMG_ERROR: error %d\n", ne->error);
+
+ /* since linux-4.11 -ENETUNREACH is returned when no route can be
+ * found. Don't print any error message in this case */
+ if (ne->error != -ENETUNREACH)
+ {
+ msg(M_WARN, "GDG6: NLMSG_ERROR: error %s\n",
+ strerror(-ne->error));
+ }
break;
}