Re: [PATCH] Add support of disabling IPv6.

2019-05-19 Thread Gris Ge via networkmanager-list
On Sat, May 18, 2019 at 05:24:31PM +0200, Thomas Haller wrote:
> On Sat, 2019-05-18 at 20:32 +0800, Gris Ge via networkmanager-list
> wrote:
> > **My first patch to NM, need some help for test cases**
> > 
> > Use NM_SETTING_IP6_CONFIG_METHOD_DISABLED/"disabled" for disabling
> > IPv6 per profile.
> > 
> > Signed-off-by: Gris Ge 
> 
> 
> Hi Gris,
> 
> great that you gave it a shot!!
> 
> 
> But unfortunately, Beniamino already was working on this (we
> understood that you would not find the time to implement this).
I through he give me a while on this. Anyway, good to know.
> 
> It's here:
> 
> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/129
> 
> Maybe you could review hi merge-request and compare it with what you
> did?
Sure. Will do.

-- 
Gris Ge


signature.asc
Description: PGP signature
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] Add support of disabling IPv6.

2019-05-18 Thread Thomas Haller via networkmanager-list
On Sat, 2019-05-18 at 20:32 +0800, Gris Ge via networkmanager-list
wrote:
> **My first patch to NM, need some help for test cases**
> 
> Use NM_SETTING_IP6_CONFIG_METHOD_DISABLED/"disabled" for disabling
> IPv6 per profile.
> 
> Signed-off-by: Gris Ge 


Hi Gris,

great that you gave it a shot!!


But unfortunately, Beniamino already was working on this (we understood
that you would not find the time to implement this).

It's here:

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/129

Maybe you could review hi merge-request and compare it with what you
did?

Future contributions are very welcome :)


best,
Thomas


signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] Add support of disabling IPv6.

2019-05-18 Thread Gris Ge via networkmanager-list
**My first patch to NM, need some help for test cases**

Use NM_SETTING_IP6_CONFIG_METHOD_DISABLED/"disabled" for disabling
IPv6 per profile.

Signed-off-by: Gris Ge 
---
 clients/common/nm-meta-setting-desc.c |  3 +-
 clients/common/nm-vpn-helpers.c   |  2 +-
 clients/common/settings-docs.h.in |  2 +-
 clients/tui/nmt-page-ip6.c|  1 +
 libnm-core/nm-connection.c| 63 +++
 libnm-core/nm-setting-ip-config.c |  6 +-
 libnm-core/nm-setting-ip6-config.c| 10 +++
 libnm-core/nm-setting-ip6-config.h|  8 +++
 src/NetworkManagerUtils.c |  9 ++-
 src/devices/nm-device.c   | 17 +++--
 src/devices/wwan/nm-modem.c   |  8 ++-
 src/initrd/nmi-cmdline-reader.c   |  2 +-
 src/initrd/nmi-ibft-reader.c  |  2 +-
 .../plugins/ifcfg-rh/nms-ifcfg-rh-reader.c|  5 +-
 .../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c|  3 +-
 15 files changed, 95 insertions(+), 46 deletions(-)

diff --git a/clients/common/nm-meta-setting-desc.c 
b/clients/common/nm-meta-setting-desc.c
index 98cb50405..209146f15 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -5734,7 +5734,8 @@ static const NMMetaPropertyInfo *const 
property_infos_IP6_CONFIG[] = {
  
NM_SETTING_IP6_CONFIG_METHOD_DHCP,
  
NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
  
NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
- 
NM_SETTING_IP6_CONFIG_METHOD_SHARED),
+ 
NM_SETTING_IP6_CONFIG_METHOD_SHARED,
+ 
NM_SETTING_IP6_CONFIG_METHOD_DISABLED),
),
),
PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS, 
DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS,
diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c
index 081d60561..c06dcb4ee 100644
--- a/clients/common/nm-vpn-helpers.c
+++ b/clients/common/nm-vpn-helpers.c
@@ -737,7 +737,7 @@ fail_invalid_secret:
}
 
for (is_v4 = 0; is_v4 < 2; is_v4++) {
-   const char *method_disabled = is_v4 ? 
NM_SETTING_IP4_CONFIG_METHOD_DISABLED : NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
+   const char *method_disabled = is_v4 ? 
NM_SETTING_IP4_CONFIG_METHOD_DISABLED : NM_SETTING_IP6_CONFIG_METHOD_DISABLED;
const char *method_manual   = is_v4 ? 
NM_SETTING_IP4_CONFIG_METHOD_MANUAL   : NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
NMSettingIPConfig *s_ip = is_v4 ? s_ip4 
: s_ip6;
GPtrArray *data_dns = is_v4 ? data_dns_v4   
: data_dns_v6;
diff --git a/clients/common/settings-docs.h.in 
b/clients/common/settings-docs.h.in
index 811f2f16d..e3df4f117 100644
--- a/clients/common/settings-docs.h.in
+++ b/clients/common/settings-docs.h.in
@@ -214,7 +214,7 @@
 #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS N_("When \"method\" 
is set to \"auto\" and this property to TRUE, automatically configured 
nameservers and search domains are ignored and only nameservers and search 
domains specified in the \"dns\" and \"dns-search\" properties, if any, are 
used.")
 #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES N_("When 
\"method\" is set to \"auto\" and this property to TRUE, automatically 
configured routes are ignored and only routes specified in the \"routes\" 
property, if any, are used.")
 #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_MAY_FAIL N_("If TRUE, allow overall 
network configuration to proceed even if the configuration specified by this 
property times out.  Note that at least one IP configuration must succeed or 
overall network configuration will still fail.  For example, in IPv6-only 
networks, setting this property to TRUE on the NMSettingIP4Config allows the 
overall network configuration to succeed if IPv4 configuration fails but IPv6 
configuration completes successfully.")
-#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_METHOD N_("IP configuration method. 
NMSettingIP4Config and NMSettingIP6Config both support \"auto\", \"manual\", 
and \"link-local\". See the subclass-specific documentation for other values. 
In general, for the \"auto\" method, properties such as \"dns\" and \"routes\" 
specify information that is added on to the information returned from automatic 
configuration.  The \"ignore-auto-routes\" and \"ignore-auto-dns\" properties 
modify this behavior. For methods that imply no upstream network, such as 
\"shared\" or \"link-local\", these properties must be empty. For IPv4 method 
\"shared\", the IP subnet can be configured by ad