mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 12:10:10 +01:00
platform: prettify and line-wrap route_to_string() print statements
(cherry picked from commit 2170804213)
This commit is contained in:
parent
e7504376dc
commit
14ef5f6b32
1 changed files with 25 additions and 6 deletions
|
|
@ -2672,10 +2672,20 @@ nm_platform_ip4_route_to_string (const NMPlatformIP4Route *route)
|
|||
|
||||
_to_string_dev (NULL, route->ifindex, str_dev, sizeof (str_dev));
|
||||
|
||||
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s%s%s",
|
||||
s_network, route->plen, s_gateway,
|
||||
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer),
|
||||
"%s/%d"
|
||||
" via %s"
|
||||
"%s"
|
||||
" metric %"G_GUINT32_FORMAT
|
||||
" mss %"G_GUINT32_FORMAT
|
||||
" src %s" /* source */
|
||||
"%s%s" /* scope */
|
||||
"",
|
||||
s_network, route->plen,
|
||||
s_gateway,
|
||||
str_dev,
|
||||
route->metric, route->mss,
|
||||
route->metric,
|
||||
route->mss,
|
||||
source_to_string (route->source),
|
||||
route->scope_inv ? " scope " : "",
|
||||
route->scope_inv ? (rtnl_scope2str (nm_platform_route_scope_inv (route->scope_inv), str_scope, sizeof (str_scope))) : "");
|
||||
|
|
@ -2707,10 +2717,19 @@ nm_platform_ip6_route_to_string (const NMPlatformIP6Route *route)
|
|||
|
||||
_to_string_dev (NULL, route->ifindex, str_dev, sizeof (str_dev));
|
||||
|
||||
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s",
|
||||
s_network, route->plen, s_gateway,
|
||||
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer),
|
||||
"%s/%d"
|
||||
" via %s"
|
||||
"%s"
|
||||
" metric %"G_GUINT32_FORMAT
|
||||
" mss %"G_GUINT32_FORMAT
|
||||
" src %s" /* source */
|
||||
"",
|
||||
s_network, route->plen,
|
||||
s_gateway,
|
||||
str_dev,
|
||||
route->metric, route->mss,
|
||||
route->metric,
|
||||
route->mss,
|
||||
source_to_string (route->source));
|
||||
return _nm_platform_to_string_buffer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue