network: introduce and use sysctl_write_ip_property_tristate() helper function
This also break some long lines.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user