From 8af20e56ed563e71977f5d5b1c136d3a3fa42c08 Mon Sep 17 00:00:00 2001 From: Pooyan Khanjankhani Date: Tue, 23 Jun 2026 13:13:09 +0330 Subject: [PATCH] Fix typos throughout the codebase Corrected spelling errors in comments and function names: - recieved/receive -> received/receive - error_occured -> error_occurred - prefered -> preferred - wierd -> weird - datastuctures -> datastructures - explictly -> explicitly - ouptut -> output - arrising -> arising - encapulation -> encapsulation - scrips -> scripts - adn-hosts -> addn-hosts - removed repeated 'the the' in three comments Generated by AI (opencode). --- src/cache.c | 6 +++--- src/dnsmasq.c | 2 +- src/dnsmasq.h | 4 ++-- src/forward.c | 4 ++-- src/lease.c | 2 +- src/network.c | 2 +- src/option.c | 2 +- src/radv.c | 2 +- src/rfc3315.c | 4 ++-- src/tftp.c | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cache.c b/src/cache.c index e51f289..f4c999c 100644 --- a/src/cache.c +++ b/src/cache.c @@ -2309,7 +2309,7 @@ static char *edestr(int ede) } } -static int error_occured(unsigned int flags) { +static int error_occurred(unsigned int flags) { if (flags & F_RCODE) return 1; else if (flags & F_NEG) @@ -2330,10 +2330,10 @@ void log_query(unsigned int flags, char *name, union all_addr *addr, char *arg, if (!option_bool(OPT_LOG)) return; - if(option_bool(OPT_LOG_ONLY_FAILED) && !error_occured(flags)) + if(option_bool(OPT_LOG_ONLY_FAILED) && !error_occurred(flags)) return; - /* F_NOERR is reused here to indicate logs arrising from auth queries */ + /* F_NOERR is reused here to indicate logs arising from auth queries */ if (!(flags & F_NOERR) && option_bool(OPT_AUTH_LOG)) return; diff --git a/src/dnsmasq.c b/src/dnsmasq.c index 50e8b23..c1e48fc 100644 --- a/src/dnsmasq.c +++ b/src/dnsmasq.c @@ -1935,7 +1935,7 @@ static void check_dns_listeners(time_t now) /* Note that handling events here can create or destroy fds and render the result of the last poll() call invalid. Once we find an fd that needs service, do it, then return to go around the - poll() loop again. This avoid really, really, wierd bugs. */ + poll() loop again. This avoid really, really, weird bugs. */ if (!option_bool(OPT_DEBUG)) for (i = 0; i < daemon->max_procs; i++) diff --git a/src/dnsmasq.h b/src/dnsmasq.h index 88171f9..ecff18d 100644 --- a/src/dnsmasq.h +++ b/src/dnsmasq.h @@ -723,7 +723,7 @@ struct resolvc { #endif }; -/* adn-hosts parms from command-line (also dhcp-hostsfile and dhcp-optsfile and dhcp-hostsdir*/ +/* addn-hosts parms from command-line (also dhcp-hostsfile and dhcp-optsfile and dhcp-hostsdir*/ #define AH_DIR 1 #define AH_INACTIVE 2 #define AH_WD_DONE 4 @@ -1171,7 +1171,7 @@ struct dhcp_relay { }; extern struct daemon { - /* datastuctures representing the command-line and + /* datastructures representing the command-line and config file arguments. All set (including defaults) in option.c */ diff --git a/src/forward.c b/src/forward.c index acaaafc..f736c30 100644 --- a/src/forward.c +++ b/src/forward.c @@ -1284,7 +1284,7 @@ void reply_query(int fd, time_t now) had replies from all to avoid filling the forwarding table when everything is broken */ - /* decrement count of replies recieved if we sent to more than one server. */ + /* decrement count of replies received if we sent to more than one server. */ if (forward->forwardall && (--forward->forwardall > 1) && RCODE(header) == REFUSED) return; @@ -2123,7 +2123,7 @@ static ssize_t tcp_talk(int first, int last, int start, struct dns_header *heade #if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) /* TCP connections by default take ages to time out. Set shorter timeouts more appropriate for a DNS server. - We set the recieve timeout as twice the send timeout; we + We set the receive timeout as twice the send timeout; we want to fail quickly on a non-responsive server, but give it time to get an answer. */ tv.tv_sec = TCP_TIMEOUT; diff --git a/src/lease.c b/src/lease.c index 1de7b4c..2fbb7a8 100644 --- a/src/lease.c +++ b/src/lease.c @@ -527,7 +527,7 @@ void lease_update_slaac(time_t now) /* Find interfaces associated with leases at start-up. This gets updated as we do DHCP transactions, but information about directly-connected subnets - is useful from scrips and necessary for determining SLAAC addresses from + is useful from scripts and necessary for determining SLAAC addresses from start-time. */ void lease_find_interfaces(time_t now) { diff --git a/src/network.c b/src/network.c index 56e2632..6c4469d 100644 --- a/src/network.c +++ b/src/network.c @@ -1457,7 +1457,7 @@ static struct serverfd *allocate_sfd(union mysockaddr *addr, char *intname, unsi /* when using random ports, servers which would otherwise use the INADDR_ANY/port0 socket have sfd set to NULL, this is - anything without an explictly set source port. */ + anything without an explicitly set source port. */ if (!daemon->osport) { errno = 0; diff --git a/src/option.c b/src/option.c index 3d63e32..2341dfb 100644 --- a/src/option.c +++ b/src/option.c @@ -1383,7 +1383,7 @@ static void dhcp_netid_list_free(struct dhcp_netid_list *netid) netid = netid->next; /* Note: don't use dhcp_netid_free() here, since that frees a list linked on netid->next. Where a netid_list - is used that's because the the ->next pointers in the + is used that's because the ->next pointers in the netids are being used to temporarily construct a list of valid tags. */ free(tmplist->list->net); diff --git a/src/radv.c b/src/radv.c index 54277bc..00c2aa7 100644 --- a/src/radv.c +++ b/src/radv.c @@ -58,7 +58,7 @@ static int add_prefixes(struct in6_addr *local, int prefix, unsigned int preferred, unsigned int valid, void *vparam); static int iface_search(struct in6_addr *local, int prefix, int scope, int if_index, int flags, - unsigned int prefered, unsigned int valid, void *vparam); + unsigned int preferred, unsigned int valid, void *vparam); static int add_lla(int index, unsigned int type, char *mac, size_t maclen, void *parm); static void new_timeout(struct dhcp_context *context, char *iface_name, time_t now); static unsigned int calc_lifetime(struct ra_interface *ra); diff --git a/src/rfc3315.c b/src/rfc3315.c index 2ac6f86..408777d 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -255,10 +255,10 @@ static int dhcp6_maybe_relay(struct state *state, unsigned char *inbuff, size_t /* the packet data is unaligned, copy to aligned storage */ memcpy(&align, inbuff + 2, IN6ADDRSZ); - /* RFC6221 para 4 says if link_address in encapulation + /* RFC6221 para 4 says if link_address in encapsulation is zero, ignore it, and, by implication, use the link address of any enclosing encapsulation or, failing that - of the arrival interface on the the server. */ + of the arrival interface on the server. */ if (!dhcp6_maybe_relay(state, opt6_ptr(opt, 0), opt6_len(opt), client_addr, IN6_IS_ADDR_UNSPECIFIED(&align) ? link_address : &align, now)) return 0; diff --git a/src/tftp.c b/src/tftp.c index 1415b0d..6d5d56d 100644 --- a/src/tftp.c +++ b/src/tftp.c @@ -855,7 +855,7 @@ static char *next(char **p, char *end) return ret; } -/* If we don't do anything, don't write the the input/ouptut +/* If we don't do anything, don't write the input/output buffer. This allows us to pass in safe read-only strings constants. */ static void sanitise(char *buf) {