summaryrefslogtreecommitdiffstats
path: root/src/net/udp/dns.c
Commit message (Collapse)AuthorAgeFilesLines
* [dns] Ensure DNS names are NUL-terminated when used as diagnostic stringsMichael Brown2017-09-071-3/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Report current DNS query as job progress status messageMichael Brown2017-09-061-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Rename ipv6_scope to dhcpv6_scopeMichael Brown2016-07-161-1/+1
| | | | | | | | The settings scope ipv6_scope refers specifically to IPv6 settings that have a corresponding DHCPv6 option. Rename to dhcpv6_scope to more accurately reflect this purpose. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Create space for IPv6 in settings display orderMichael Brown2016-07-151-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Update end-of-name pointer after processing CNAME recordMichael Brown2014-02-261-2/+12
| | | | | | | | | | | | | | | | | | | | | Commit d4c0226 ("[dns] Support DNS search lists") introduced a regression when handling CNAME records resolving to names longer than the original name. The "end of name" offset stored in dns->offset was not updated to reflect the length of the new name, causing dns_question() to append the (empty) search suffix at an incorrect offset within the name buffer, resulting in a mangled DNS name. In the case of a CNAME record resolving to a name shorter than or equal in length to the original name, then the mangling would occur in an unused portion of the name buffer. In the common case of a name server returning the A (or AAAA) record along with the CNAME record, this would cause name resolution to succeed despite the mangling. (If the name server did not return the A or AAAA record along with the CNAME record, then the mangling would be revealed by the subsequent invalid query packet.) Reported-by: Nicolas Sylvain <nsylvain@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Support DNS search listsMichael Brown2014-02-051-265/+703
| | | | | | | | | | | Update the DNS resolver to support DNS search lists (as provided by DHCP option 119, DHCPv6 option 24, or NDP option 31). Add validation code to ensure that parsing of DNS packets does not overrun the input, get stuck in infinite loops, or (worse) write beyond the end of allocated buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Merge SETTING_IPv4 and SETTING_IPv6Michael Brown2013-12-051-2/+2
| | | | | | | Allow for equivalent IPv4 and IPv6 settings (which requires equivalent settings to be adjacent within the settings list). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-051-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Add support for resolving IPv6 addresses via AAAA recordsMichael Brown2013-12-051-33/+102
| | | | | | | | Our policy is to prefer IPv6 addreses to IPv4 addresses, but to request IPv6 addresses only if we have an IPv6 address for the name server itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-6/+2Star
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix uses of literal 0 as a NULL pointerMichael Brown2013-04-281-1/+1
| | | | | | Detected using sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [src] Fix spelling in comments, debug messages and local variable namesStefan Weil2013-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes in comments and debug messages: existance -> existence unecessary -> unnecessary occured -> occurred decriptor -> descriptor neccessary -> necessary addres, adress -> address initilize -> initialize sucessfully -> successfully paramter -> parameter acess -> access upto -> up to likelyhood ->likelihood thru -> through substracting -> subtracting lenght -> length isnt -> isn't interupt -> interrupt publically -> publicly (this one was not wrong, but unusual) recieve -> receive accessable -> accessible seperately -> separately pacet -> packet controled -> controlled dectect -> detect indicies -> indices extremly -> extremely boundry -> boundary usefull -> useful unuseable -> unusable auxilliary -> auxiliary embeded -> embedded enviroment -> environment sturcture -> structure complier -> compiler constructes -> constructs supress -> suppress intruduced -> introduced compatability -> compatibility verfication -> verification ths -> the reponse -> response Fixes in local variable names: retreive -> retrieve Most of these fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Move "domain" setting from dns.c to settings.cMichael Brown2012-06-201-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Allow trailing dots in DNS namesMichael Brown2012-01-111-9/+15
| | | | | Reported-by: Christian Hesse <list@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Match terminology in online documentationMichael Brown2011-03-231-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-231-2/+2
| | | | | | | Improve the appearance of the "config" user interface by ensuring that settings appear in some kind of logical order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Fix memory leak in settings applicatorMichael Brown2011-03-031-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Disambiguate "no nameserver" and "no DNS record" errorsMichael Brown2010-12-011-2/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Hold reference while timer is running and during expiry callbackMichael Brown2010-09-031-1/+1
| | | | | | | | | Guarantee that a retry timer cannot go out of scope while the timer is running, and provide a guarantee to the expiry callback that the timer will remain in scope during the entire callback (similar to the guarantee provided to interface methods). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-221-36/+45
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-6/+18
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Add timer_init() wrapper functionMichael Brown2010-06-221-1/+1
| | | | | | | Standardise on using timer_init() to initialise an embedded retry timer, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-221-0/+1
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-9/+9
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [xfer] Implement xfer_vreopen() to properly handle redirectionsMichael Brown2009-03-301-1/+1
| | | | | When handling a redirection event, we need to close the existing connection before opening the new connection.
* [dns] Append local domain to relative namesStefan Hajnoczi2009-01-271-11/+65
| | | | | | | | | | | | | | | Try to qualify relative names in the DNS resolver using the DHCP Domain Name. For example: DHCP Domain Name: etherboot.org (Relative) Name: www yields: www.etherboot.org Only names with no dots ('.') will be modified. A name with one or more dots is unchanged.
* [Settings] Remove assumption that all settings have DHCP tag valuesMichael Brown2008-03-251-1/+16
| | | | | | | | | | | | Allow for settings to be described by something other than a DHCP option tag if desirable. Currently used only for the MAC address setting. Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c. Remove notion of settings from dhcppkt.c. Rationalise dhcp.c to use settings API only for final registration of the DHCP options, rather than using {store,fetch}_setting throughout.
* [Settings] Introduce settings applicators.Michael Brown2008-03-211-18/+17Star
| | | | | | | Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
* Make seek information part of the xfer metadata, rather than an entirelyMichael Brown2008-01-081-1/+0Star
| | | | | | | separate xfer method. Add missing .alloc_iob entries to several xfer_interface_operations structures.
* Allowed zero-cost enforced ordering of features in startup bannerMichael Brown2007-08-021-0/+3
| | | | | | list. Added FEATURE() macros to most relevant (non-driver) files.
* nameserver should be staticMichael Brown2007-07-171-1/+1
|
* Add debug message when nameserver setting is applied/changed via DHCP.Michael Brown2007-07-081-0/+4
|
* Separate the "is data ready" function of xfer_seek() into anMichael Brown2007-07-081-0/+1
| | | | | xfer_window() function, which can return a scalar rather than a boolean.
* Kill off unused request() method in data-xfer interface.Michael Brown2007-07-081-1/+0Star
|
* convert to zallocHolger Lubitz2007-07-061-2/+1Star
|
* Add concept of DHCP option applicators.Michael Brown2007-07-051-0/+23
|
* Updated DNS to use not-yet-implemented UDP data-xfer API.Michael Brown2007-06-121-101/+114
|
* Introduce name resolution interface and named socket opener.Michael Brown2007-05-271-1/+1
|
* Added SIGKILL handlerMichael Brown2007-01-191-0/+15
|
* A working name resolution frameworkMichael Brown2007-01-181-0/+7
|
* Have DHCP set the nameserver, rather than DNS read the DHCP nameserverMichael Brown2007-01-181-12/+16
| | | | value.
* Use struct sockaddr rather than struct sockaddr_tcpipMichael Brown2007-01-181-9/+12
| | | | Tidy up code
* A working DNS resolver (not yet tied in to anything)Michael Brown2007-01-151-0/+463