From 42cf6395c4419440db47b0569409fdaec78fe74b Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Thu, 15 Nov 2018 10:33:28 -0800 Subject: [PATCH] CLEANUP: Fix typos in the dns subsystem Fix misspells in the code comments of the dns subsystem. --- include/types/dns.h | 8 ++++---- src/dns.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/types/dns.h b/include/types/dns.h index 488d3996c..d7afe02cd 100644 --- a/include/types/dns.h +++ b/include/types/dns.h @@ -88,7 +88,7 @@ #define DNS_FLAG_TRUNCATED 0x0200 /* mask for truncated flag */ #define DNS_FLAG_REPLYCODE 0x000F /* mask for reply code */ -/* max number of network preference entries are avalaible from the +/* max number of network preference entries are available from the * configuration file. */ #define SRV_MAX_PREF_NET 5 @@ -244,7 +244,7 @@ struct dns_options { struct in6_addr in6; } mask; } pref_net[SRV_MAX_PREF_NET]; - int pref_net_nb; /* The number of registered prefered networks. */ + int pref_net_nb; /* The number of registered preferred networks. */ int accept_duplicate_ip; /* flag to indicate whether the associated object can use an IP address already set to an other object of the same group */ }; @@ -265,7 +265,7 @@ struct dns_resolution { unsigned int last_valid; /* time of the last valid response */ int query_id; /* DNS query ID dedicated for this resolution */ struct eb32_node qid; /* ebtree query id */ - int prefered_query_type; /* prefered query type */ + int prefered_query_type; /* preferred query type */ int query_type; /* current query type */ int status; /* status of the resolution being processed RSLV_STATUS_* */ int step; /* RSLV_STEP_* */ @@ -292,7 +292,7 @@ struct dns_requester { /* Last resolution status code */ enum { - RSLV_STATUS_NONE = 0, /* no resolution occured yet */ + RSLV_STATUS_NONE = 0, /* no resolution occurred yet */ RSLV_STATUS_VALID, /* no error */ RSLV_STATUS_INVALID, /* invalid responses */ RSLV_STATUS_ERROR, /* error */ diff --git a/src/dns.c b/src/dns.c index 57bec21dc..5bce18b03 100644 --- a/src/dns.c +++ b/src/dns.c @@ -974,14 +974,14 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p, max_score = -1; /* Select an IP regarding configuration preference. - * Top priority is the prefered network ip version, - * second priority is the prefered network. + * Top priority is the preferred network ip version, + * second priority is the preferred network. * the last priority is the currently used IP, * * For these three priorities, a score is calculated. The * weight are: - * 8 - prefered ip version. - * 4 - prefered network. + * 8 - preferred ip version. + * 4 - preferred network. * 2 - if the ip in the record is not affected to any other server in the same backend (duplication) * 1 - current ip. * The result with the biggest score is returned. @@ -1003,11 +1003,11 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p, continue; score = 0; - /* Check for prefered ip protocol. */ + /* Check for preferred ip protocol. */ if (ip_type == family_priority) score += 8; - /* Check for prefered network. */ + /* Check for preferred network. */ for (j = 0; j < dns_opts->pref_net_nb; j++) { /* Compare only the same adresses class. */