mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
netconfig: Use inet_ntop instead of inet_ntoa
This commit is contained in:
parent
772aa687d7
commit
094537efc6
@ -625,8 +625,8 @@ static bool netconfig_ipv4_routes_install(struct netconfig *netconfig)
|
|||||||
{
|
{
|
||||||
L_AUTO_FREE_VAR(char *, gateway) = NULL;
|
L_AUTO_FREE_VAR(char *, gateway) = NULL;
|
||||||
struct in_addr in_addr;
|
struct in_addr in_addr;
|
||||||
char *network;
|
|
||||||
char ip[INET_ADDRSTRLEN];
|
char ip[INET_ADDRSTRLEN];
|
||||||
|
char network[INET_ADDRSTRLEN];
|
||||||
unsigned int prefix_len =
|
unsigned int prefix_len =
|
||||||
l_rtnl_address_get_prefix_length(netconfig->v4_address);
|
l_rtnl_address_get_prefix_length(netconfig->v4_address);
|
||||||
|
|
||||||
@ -637,8 +637,7 @@ static bool netconfig_ipv4_routes_install(struct netconfig *netconfig)
|
|||||||
in_addr.s_addr = in_addr.s_addr &
|
in_addr.s_addr = in_addr.s_addr &
|
||||||
htonl(0xFFFFFFFFLU << (32 - prefix_len));
|
htonl(0xFFFFFFFFLU << (32 - prefix_len));
|
||||||
|
|
||||||
network = inet_ntoa(in_addr);
|
if (!inet_ntop(AF_INET, &in_addr, network, INET_ADDRSTRLEN))
|
||||||
if (!network)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!l_rtnl_route4_add_connected(rtnl, netconfig->ifindex,
|
if (!l_rtnl_route4_add_connected(rtnl, netconfig->ifindex,
|
||||||
|
Loading…
Reference in New Issue
Block a user