platform: improve logging message for failure to add route

The errno for this particular failure differs between IPv4 and IPv6.
Of course it does.
This commit is contained in:
Thomas Haller
2018-03-22 16:56:28 +01:00
parent de750acee7
commit 03a9bb88aa

View File

@@ -3989,10 +3989,12 @@ nm_platform_ip_route_sync (NMPlatform *self,
} else {
const char *reason = "";
if ( -((int) plerr) == ENETUNREACH
&& ( vt->is_ip4
? !!NMP_OBJECT_CAST_IP4_ROUTE (conf_o)->gateway
: !IN6_IS_ADDR_UNSPECIFIED (&NMP_OBJECT_CAST_IP6_ROUTE (conf_o)->gateway)))
if ( ( -((int) plerr) == ENETUNREACH
&& vt->is_ip4
&& !!NMP_OBJECT_CAST_IP4_ROUTE (conf_o)->gateway)
|| ( -((int) plerr) == EHOSTUNREACH
&& !vt->is_ip4
&& !IN6_IS_ADDR_UNSPECIFIED (&NMP_OBJECT_CAST_IP6_ROUTE (conf_o)->gateway)))
reason = "; is the gateway directly reachable?";
_LOGW ("route-sync: failure to add IPv%c route: %s: %s%s",