Bug 1517794
| Summary: | [NMCI] resolv.conf options are not removed properly | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Vladimir Benes <vbenes> | ||||||
| Component: | NetworkManager | Assignee: | Beniamino Galvani <bgalvani> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> | ||||||
| Severity: | unspecified | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 7.5 | CC: | atragler, bgalvani, fgiudici, lmiksik, lrintel, rkhan, sukulkar, thaller | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2018-04-10 13:34:16 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Branch bg/ifcfg-rh-dns-rh1517794. (In reply to Beniamino Galvani from comment #1) > Branch bg/ifcfg-rh-dns-rh1517794. network_ifcfg = svOpenFile (network_file, NULL); ... - dns_options = svGetValue (network_ifcfg, "RES_OPTIONS", &dns_options_free); + dns_options = svGetValue (network_ifcfg, "IPV6_RES_OPTIONS", &dns_options_free); network_ifcfg is /etc/sysconfig/network which we parse for backward compat. In fact, merging settings from this file (that we don't write) results in a difference at re-read. But for legacy, that is fine. You just don't need to use the new IPV6_RES_OPTIONS for this file. + if (NM_IN_STRSET (nm_setting_ip_config_get_method (s_ip), + NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + return; + I don't think you should verify the connection. Either nm_connection_verify() should reject connections as invalid with method=ignore + dns-options, or the writer should just handle them. Same for the reader. Reader/writer should only add additional logic where really necessary (like, converting a string to an enum). could you rewrite write_res_options() to not use @array? + if (!s_ip) + return; also, write_res_option() should either set or unset the value. Just return is wrong. How about now? lgtm Merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6f5f1b2d29f4458695bffae750fc0f6aab3bfa10 and nm-1-10. Created attachment 1363919 [details]
[PATCH] ifcfg-rh: use separate variables for DNS searches
gs_free char *ip4_domains = NULL;
nm_auto_free_gstring GString *searches = NULL;
- searches = g_string_new (svGetValueStr (ifcfg, "DOMAIN", &ip4_domains));
ip4_domains is now unused.
/* FIXME: currently DNS domains from IPv6 setting are stored in 'DOMAIN' key in ifcfg-file
* However after re-reading they are dropped into IPv4 setting.
* So, in order to comparison succeeded, move DNS domains back to IPv6 setting.
*/
reread_s_ip4 = nm_connection_get_setting_ip4_config (reread);
reread_s_ip6 = nm_connection_get_setting_ip6_config (reread);
- nm_setting_ip_config_add_dns_search (reread_s_ip6, nm_setting_ip_config_get_dns_search (reread_s_ip4, 2));
isn't this FIXME comment obsolete as well?
Created attachment 1364096 [details] [PATCH v2] ifcfg-rh: use separate variables for DNS searches (In reply to Thomas Haller from comment #9) > ip4_domains is now unused. > isn't this FIXME comment obsolete as well? Both fixed. (In reply to Beniamino Galvani from comment #10) > Both fixed. lgtm Applied to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a9b507932465888504cbf93bcf3a86b1c3b1df79 and nm-1-10. works well again Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0778 |
Description of problem: when I set dns option for ipv4, I have to remove it for both ipv4 and ipv6 to get it removed. This is wrong. @ipv4_remove_dns_options Scenario: nmcli - ipv4 - dns-options - remove * Add a new connection of type "ethernet" and options "ifname eth10 con-name ethie autoconnect no" * Execute "nmcli con modify ethie ipv4.dns-options debug ipv4.may-fail no" * Bring "up" connection "ethie" * Execute "nmcli con modify ethie ipv4.dns-options ' '" * Bring "up" connection "ethie" Then "options debug" is not visible with command "cat /etc/resolv.conf" in "5" seconds Version-Release number of selected component (if applicable): NetworkManager-1.10.0-1.el7.x86_64 How reproducible: always Steps to Reproduce: 1. see above Actual results: dns option debug still there workaround: nmcli con modify ethie ipv4.dns-options ' ' ipv6.dns-options ' ' Expected results: dns option not thres Additional info: affects ipv4/ipv6 in nmcli and also nmtui in: ipv6_dns_search_remove_dns_search