Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1480857 Details for
Bug 1438398
iPXE itself does not support multiple DNS servers
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
draft patch 0 for dns2 option
dns2.patch (text/plain), 4.32 KB, created by
Neil Horman
on 2018-09-04 17:48:58 UTC
(
hide
)
Description:
draft patch 0 for dns2 option
Filename:
MIME Type:
Creator:
Neil Horman
Created:
2018-09-04 17:48:58 UTC
Size:
4.32 KB
patch
obsolete
>commit 3706afbaabd35c2035deb528daadf6980b5efe1f >Author: Neil Horman <nhorman@tuxdriver.com> >Date: Tue Sep 4 13:46:02 2018 -0400 > > Add backup dns server to dns configuration > > IPXE currently only allows a single dns server. It would be nice if a > backup could be configured. This is a first pass at that patch > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com> > >diff --git a/src/include/ipxe/settings.h b/src/include/ipxe/settings.h >index f463e667..b9089d94 100644 >--- a/src/include/ipxe/settings.h >+++ b/src/include/ipxe/settings.h >@@ -438,6 +438,8 @@ gateway_setting __setting ( SETTING_IP4, gateway ); > extern const struct setting > dns_setting __setting ( SETTING_IP4_EXTRA, dns ); > extern const struct setting >+dns_setting __setting ( SETTING_IP4_EXTRA, dns2 ); >+extern const struct setting > ip6_setting __setting ( SETTING_IP6, ip6 ); > extern const struct setting > len6_setting __setting ( SETTING_IP6, len6 ); >diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c >index f412f710..fd3a4da1 100644 >--- a/src/net/udp/dns.c >+++ b/src/net/udp/dns.c >@@ -78,6 +78,17 @@ static union { > /** The DNS search list */ > static struct dns_name dns_search; > >+static struct setting *current_v4_setting = NULL; >+ >+static int _apply_dns_settings ( const struct setting *setting6, >+ const struct setting *setting4 ); >+static int dns_resolv ( struct interface *resolv, >+ const char *name, struct sockaddr *sa ); >+ >+const struct setting dns6_setting; >+const struct setting dns2_setting; >+const struct setting dns_setting; >+ > /** > * Encode a DNS name using RFC1035 encoding > * >@@ -446,6 +457,9 @@ struct dns_request { > struct interface socket; > /** Retry timer */ > struct retry_timer timer; >+ /** The v4 dns server setting */ >+ const struct setting *v4setting; >+ char *rawname; > > /** Socket address to fill in with resolved address */ > union { >@@ -596,6 +610,12 @@ static void dns_timer_expired ( struct retry_timer *timer, int fail ) { > container_of ( timer, struct dns_request, timer ); > > if ( fail ) { >+ if (dns->v4setting == &dns_setting) { >+ _apply_dns_settings(&dns6_setting, &dns2_setting); >+ dns_resolv(&dns->resolv, dns->rawname, &dns->address.sa); >+ } else { >+ _apply_dns_settings(&dns6_setting, &dns2_setting); >+ } > dns_done ( dns, -ETIMEDOUT ); > } else { > dns_send_packet ( dns ); >@@ -943,6 +963,10 @@ static int dns_resolv ( struct interface *resolv, > rc = -ENOMEM; > goto err_alloc_dns; > } >+ >+ dns->v4setting = current_v4_setting; >+ dns->rawname = strdup(name); >+ > ref_init ( &dns->refcnt, NULL ); > intf_init ( &dns->resolv, &dns_resolv_desc, &dns->refcnt ); > intf_init ( &dns->socket, &dns_socket_desc, &dns->refcnt ); >@@ -1079,6 +1103,13 @@ const struct setting dns_setting __setting ( SETTING_IP4_EXTRA, dns ) = { > .type = &setting_type_ipv4, > }; > >+const struct setting dns2_setting __setting ( SETTING_IP4_EXTRA, dns2 ) = { >+ .name = "dns2", >+ .description = "DNS backup server", >+ .tag = DHCP_DNS_SERVERS, >+ .type = &setting_type_ipv4, >+}; >+ > /** IPv6 DNS server setting */ > const struct setting dns6_setting __setting ( SETTING_IP6_EXTRA, dns6 ) = { > .name = "dns6", >@@ -1137,14 +1168,15 @@ static void apply_dns_search ( void ) { > * > * @ret rc Return status code > */ >-static int apply_dns_settings ( void ) { >+static int _apply_dns_settings ( const struct setting *setting6, >+ const struct setting *setting4 ) { > > /* Fetch DNS server address */ > nameserver.sa.sa_family = 0; >- if ( fetch_ipv6_setting ( NULL, &dns6_setting, >+ if ( fetch_ipv6_setting ( NULL, setting6, > &nameserver.sin6.sin6_addr ) >= 0 ) { > nameserver.sin6.sin6_family = AF_INET6; >- } else if ( fetch_ipv4_setting ( NULL, &dns_setting, >+ } else if ( fetch_ipv4_setting ( NULL, setting4, > &nameserver.sin.sin_addr ) >= 0 ) { > nameserver.sin.sin_family = AF_INET; > } >@@ -1152,6 +1184,8 @@ static int apply_dns_settings ( void ) { > DBG ( "DNS using nameserver %s\n", > sock_ntoa ( &nameserver.sa ) ); > } >+ >+ current_v4_setting = (struct setting *)setting4; > > /* Fetch DNS search list */ > apply_dns_search(); >@@ -1174,6 +1208,12 @@ static int apply_dns_settings ( void ) { > return 0; > } > >+ >+static int apply_dns_settings ( ) >+{ >+ return _apply_dns_settings(&dns6_setting, &dns_setting); >+} >+ > /** DNS settings applicator */ > struct settings_applicator dns_applicator __settings_applicator = { > .apply = apply_dns_settings,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1438398
: 1480857