3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

netconfig: remove sysfs static functions

This commit is contained in:
James Prestwood 2021-11-03 15:15:00 -07:00 committed by Denis Kenzior
parent 6ea58f9fde
commit 25936b1365

View File

@ -50,6 +50,7 @@
#include "src/util.h" #include "src/util.h"
#include "src/ie.h" #include "src/ie.h"
#include "src/netconfig.h" #include "src/netconfig.h"
#include "src/sysfs.h"
struct netconfig { struct netconfig {
uint32_t ifindex; uint32_t ifindex;
@ -102,38 +103,6 @@ static void do_debug(const char *str, void *user_data)
l_info("%s%s", prefix, str); l_info("%s%s", prefix, str);
} }
static int write_string(const char *file, const char *value)
{
size_t l = strlen(value);
int fd;
int r;
fd = L_TFR(open(file, O_WRONLY));
if (fd < 0)
return -errno;
r = L_TFR(write(fd, value, l));
L_TFR(close(fd));
return r;
}
static int sysfs_write_ipv6_setting(const char *ifname, const char *setting,
const char *value)
{
int r;
L_AUTO_FREE_VAR(char *, file) =
l_strdup_printf("/proc/sys/net/ipv6/conf/%s/%s",
ifname, setting);
r = write_string(file, value);
if (r < 0)
l_error("Unable to write %s to %s", setting, file);
return r;
}
static void netconfig_free_settings(struct netconfig *netconfig) static void netconfig_free_settings(struct netconfig *netconfig)
{ {
l_rtnl_address_free(netconfig->v4_address); l_rtnl_address_free(netconfig->v4_address);