network: introduce and use sysctl_write_ip_property_tristate() helper function

This also break some long lines.
This commit is contained in:
Yu Watanabe
2026-08-17 17:18:57 +09:00
parent a9e74be13c
commit f3ada8a0fb
2 changed files with 39 additions and 38 deletions
+7
View File
@@ -20,6 +20,13 @@ int sysctl_read_ip_property_uint32(int af, const char *ifname, const char *prope
int sysctl_write_ip_property(int af, const char *ifname, const char *property, const char *value, Hashmap **shadow);
int sysctl_write_ip_property_boolean(int af, const char *ifname, const char *property, bool value, Hashmap **shadow);
static inline int sysctl_write_ip_property_tristate(int af, const char *ifname, const char *property, int value, Hashmap **shadow) {
if (value < 0)
return 0;
return sysctl_write_ip_property_boolean(af, ifname, property, value, shadow);
}
int sysctl_write_ip_neighbor_property(int af, const char *ifname, const char *property, const char *value, Hashmap **shadow);
int sysctl_write_ip_neighbor_property_uint32(int af, const char *ifname, const char *property, uint32_t value, Hashmap **shadow);