From 5fa063f90d443044ca1dba71478c701ce7b62b94 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 8 May 2024 11:02:20 +0200 Subject: [PATCH] core: add nm_l3_config_data_set_allow_routes_without_address() Add a function to set the allow-routes-without-address flag for l3cds. It will be used in the next commit. (cherry picked from commit a3ce13c947e6eda71fa07de273ede55b806e8d45) --- src/core/nm-l3-config-data.c | 15 +++++++++++++++ src/core/nm-l3-config-data.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index fbee1bf7e..908c4d65d 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -1950,6 +1950,21 @@ nm_l3_config_data_get_allow_routes_without_address(const NML3ConfigData *self, i } } +void +nm_l3_config_data_set_allow_routes_without_address(NML3ConfigData *self, + int addr_family, + gboolean value) +{ + const int IS_IPv4 = NM_IS_IPv4(addr_family); + + nm_assert(_NM_IS_L3_CONFIG_DATA(self, FALSE)); + if (IS_IPv4) { + self->allow_routes_without_address_4 = value; + } else { + self->allow_routes_without_address_6 = value; + } +} + NMProxyConfigMethod nm_l3_config_data_get_proxy_method(const NML3ConfigData *self) { diff --git a/src/core/nm-l3-config-data.h b/src/core/nm-l3-config-data.h index 5c8491a70..faf4f0bfa 100644 --- a/src/core/nm-l3-config-data.h +++ b/src/core/nm-l3-config-data.h @@ -557,6 +557,10 @@ gboolean nm_l3_config_data_set_ip6_privacy(NML3ConfigData *self, gboolean nm_l3_config_data_get_allow_routes_without_address(const NML3ConfigData *self, int addr_family); +void nm_l3_config_data_set_allow_routes_without_address(NML3ConfigData *self, + int addr_family, + gboolean value); + NMProxyConfigMethod nm_l3_config_data_get_proxy_method(const NML3ConfigData *self); gboolean nm_l3_config_data_set_proxy_method(NML3ConfigData *self, NMProxyConfigMethod value);