diff mbox series

[2/4] Fix typos in the lib/libnet folder

Message ID 20230222154057.904578-3-thuth@redhat.com
State Accepted
Headers show
Series Fix typos | expand

Commit Message

Thomas Huth Feb. 22, 2023, 3:40 p.m. UTC
Found with the "codespell" utility.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/libnet/dhcp.c    | 6 +++---
 lib/libnet/dns.c     | 4 ++--
 lib/libnet/icmpv6.c  | 6 +++---
 lib/libnet/ipv4.c    | 6 +++---
 lib/libnet/ipv6.c    | 8 ++++----
 lib/libnet/ipv6.h    | 8 ++++----
 lib/libnet/ndp.c     | 2 +-
 lib/libnet/netload.c | 4 ++--
 lib/libnet/tftp.c    | 4 ++--
 9 files changed, 24 insertions(+), 24 deletions(-)

Comments

Segher Boessenkool Feb. 22, 2023, 4:05 p.m. UTC | #1
On Wed, Feb 22, 2023 at 04:40:55PM +0100, Thomas Huth wrote:
> Found with the "codespell" utility.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

> --- a/lib/libnet/dhcp.c
> +++ b/lib/libnet/dhcp.c
> @@ -111,7 +111,7 @@ static uint8_t dhcp_magic[] = {0x63, 0x82, 0x53, 0x63};
>   *  or to retrieve options from DHCP-msg during receiving.
>   *  <p>
>   *  If flag[i] == TRUE then field for i-th option retains valid value and
> - *  information from this field may retrived (in case of receiving) or will
> + *  information from this field may retrieved (in case of receiving) or will
>   *  be transmitted (in case of transmitting).

... may be retrieved ...

> -		// packet is completly reassambled now!
> +		// packet is completely reassambled now!

The word is "reassembled".  There is no word "reassambled", curious
that your spellchecker used that, huh.

>  /**
> - * send_ack - Sends a acknowlege package.
> + * send_ack - Sends a acknowledge package.

Send an acknowledge packet (or acknowledgement even).

All spellos except "reassambled" are spotted correctly.


Segher
Alexey Kardashevskiy Feb. 28, 2023, 5:06 a.m. UTC | #2
On 23/02/2023 03:05, Segher Boessenkool wrote:
> On Wed, Feb 22, 2023 at 04:40:55PM +0100, Thomas Huth wrote:
>> Found with the "codespell" utility.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
> 
>> --- a/lib/libnet/dhcp.c
>> +++ b/lib/libnet/dhcp.c
>> @@ -111,7 +111,7 @@ static uint8_t dhcp_magic[] = {0x63, 0x82, 0x53, 0x63};
>>    *  or to retrieve options from DHCP-msg during receiving.
>>    *  <p>
>>    *  If flag[i] == TRUE then field for i-th option retains valid value and
>> - *  information from this field may retrived (in case of receiving) or will
>> + *  information from this field may retrieved (in case of receiving) or will
>>    *  be transmitted (in case of transmitting).
> 
> ... may be retrieved ...
> 
>> -		// packet is completly reassambled now!
>> +		// packet is completely reassambled now!
> 
> The word is "reassembled".  There is no word "reassambled", curious
> that your spellchecker used that, huh.
> 
>>   /**
>> - * send_ack - Sends a acknowlege package.
>> + * send_ack - Sends a acknowledge package.
> 
> Send an acknowledge packet (or acknowledgement even).
> 
> All spellos except "reassambled" are spotted correctly.


huh, I did "setlocal spell spelllang=en_us" and got lot more of this in 
my vim. It can even highlight "a the new ARP entry" :)

I'll fix them up.
diff mbox series

Patch

diff --git a/lib/libnet/dhcp.c b/lib/libnet/dhcp.c
index 85cd7c0..84d44ba 100644
--- a/lib/libnet/dhcp.c
+++ b/lib/libnet/dhcp.c
@@ -111,7 +111,7 @@  static uint8_t dhcp_magic[] = {0x63, 0x82, 0x53, 0x63};
  *  or to retrieve options from DHCP-msg during receiving.
  *  <p>
  *  If flag[i] == TRUE then field for i-th option retains valid value and
- *  information from this field may retrived (in case of receiving) or will
+ *  information from this field may retrieved (in case of receiving) or will
  *  be transmitted (in case of transmitting).
  *
  */
@@ -233,7 +233,7 @@  int32_t dhcpv4(char *ret_buffer, filename_ip_t *fn_ip)
 		}
 	}
 
-	// Store configuration info into filename_ip strucutre
+	// Store configuration info into filename_ip structure
 	fn_ip -> own_ip = dhcp_own_ip;
 	fn_ip -> server_ip = dhcp_tftp_ip;
 	strcpy(fn_ip->filename, dhcp_filename);
@@ -507,7 +507,7 @@  static int32_t dhcp_decode_options(uint8_t opt_field[], uint32_t opt_len,
  * DHCP: Appends information from source "options" into dest "options".
  *       This function is used to support "file/sname" overloading.
  *
- * @param  dst_options   destanation "options" field
+ * @param  dst_options   destination "options" field
  * @param  dst_len       size of dst_options (modified by this function)
  * @param  src_options   source "options" field
  * @param  src_len       size of src_options
diff --git a/lib/libnet/dns.c b/lib/libnet/dns.c
index a7313a9..c759c32 100644
--- a/lib/libnet/dns.c
+++ b/lib/libnet/dns.c
@@ -95,7 +95,7 @@  static int8_t  dns_domain_cname[0x100];      /**< Canonical domain name  */
 
 /**
  * DNS: Initialize the environment for DNS client.
- *      To perfrom DNS-queries use the function dns_get_ip.
+ *      To perform DNS-queries use the function dns_get_ip.
  *
  * @param  device_socket a socket number used to send and receive packets
  * @param  server_ip     DNS-server IPv4 address (e.g. 127.0.0.1)
@@ -129,7 +129,7 @@  dns_init(uint32_t _dns_server_ip, uint8_t _dns_server_ipv6[16], uint8_t ip_versi
  * @param  url       the URL to be resolved
  * @param  domain_ip In case of SUCCESS stores extracted IP.
  *                   In case of FAULT stores zeros (0.0.0.0).
- * @return           TRUE - IP successfuly retrieved;
+ * @return           TRUE - IP successfully retrieved;
  *                   FALSE - error condition occurs.
  */
 int8_t
diff --git a/lib/libnet/icmpv6.c b/lib/libnet/icmpv6.c
index 34d7c65..bb36cc1 100644
--- a/lib/libnet/icmpv6.c
+++ b/lib/libnet/icmpv6.c
@@ -85,7 +85,7 @@  handle_prefixoption (uint8_t *option)
 	prefix_option = (struct option_prefix *) option;
 	memcpy( &(prefix.addr), &(prefix_option->prefix.addr), IPV6_ADDR_LENGTH);
 
-	/* Link-local adresses in RAs are nonsense */
+	/* Link-local addresses in RAs are nonsense */
 	if (ip6_is_linklocal(&prefix))
 		return;
 
@@ -97,7 +97,7 @@  handle_prefixoption (uint8_t *option)
 	if (!new_address)
 		return;
 
-	/* Process only prefixes we don't already have an adress from */
+	/* Process only prefixes we don't already have an address from */
 	if (!unknown_prefix (&new_address->addr)) {
 		return;
 	}
@@ -256,7 +256,7 @@  send_neighbour_solicitation (int fd, ip6_addr_t *dest_ip6)
  * @param  fd           socket fd
  * @param  ip6_packet	pointer to an IPv6 packet
  * @param  icmp6hdr	pointer to the icmp6 header in ip6_packet
- * @param  na_flags	Neighbour advertisment flags
+ * @param  na_flags	Neighbour advertisement flags
  */
 static void
 send_neighbour_advertisement (int fd, struct neighbor *target)
diff --git a/lib/libnet/ipv4.c b/lib/libnet/ipv4.c
index 3a1a789..0f633e0 100644
--- a/lib/libnet/ipv4.c
+++ b/lib/libnet/ipv4.c
@@ -25,7 +25,7 @@ 
 #define ARP_REQUEST            1
 #define ARP_REPLY              2
 
-/* ARP talbe size (+1) */
+/* ARP table size (+1) */
 #define ARP_ENTRIES 10
 
 /* ICMP Message types */
@@ -373,7 +373,7 @@  int8_t handle_ipv4(int fd, uint8_t * ip_packet, uint32_t packetsize)
 			return 0;
 		}
 
-		// packet is completly reassambled now!
+		// packet is completely reassambled now!
 
 		// recalculate ip_len and set iph and ip_packet to the
 		iph_first->ip_len = iph->ip_len + ((iph->ip_off) & 0x1FFF) * 8;
@@ -504,7 +504,7 @@  int send_ipv4(int fd, void* buffer, int len)
 		arp_entry = &arp_table[arp_producer];
 		arp_producer = (arp_producer+1)%ARP_ENTRIES;
 
-		// if ARP table is full then we must drop the oldes entry.
+		// if ARP table is full then we must drop the oldest entry.
 		if(arp_consumer == arp_producer)
 			arp_consumer = (arp_consumer+1)%ARP_ENTRIES;
 
diff --git a/lib/libnet/ipv6.c b/lib/libnet/ipv6.c
index 6420004..dd8c4ca 100644
--- a/lib/libnet/ipv6.c
+++ b/lib/libnet/ipv6.c
@@ -289,7 +289,7 @@  void *ip6_prefix2addr(ip6_addr_t prefix)
 }
 
 /**
- * NET: add new IPv6 adress to list
+ * NET: add new IPv6 address to list
  *
  * @param   ip6_addr *new_address
  * @return  0 - passed pointer = NULL;
@@ -309,7 +309,7 @@  int8_t ip6addr_add(struct ip6addr_list_entry *new_address)
 
 	/* If address is a unicast address, we also have to process packets
 	 * for its solicited-node multicast address.
-	 * See RFC 2373 - IP Version 6 Adressing Architecture */
+	 * See RFC 2373 - IP Version 6 Addressing Architecture */
 	if (! ip6_is_multicast(&(new_address->addr))) {
 		solicited_node = malloc(sizeof(struct ip6addr_list_entry));
 		if (! solicited_node)
@@ -371,7 +371,7 @@  static void ipv6_init(int fd)
 }
 
 /**
- * NET: compare IPv6 adresses
+ * NET: compare IPv6 addresses
  *
  * @param  ip6_addr ip_1
  * @param  ip6_addr ip_2
@@ -470,7 +470,7 @@  static unsigned short ip6_checksum(struct ip6hdr *ip6h, unsigned char *packet,
  * @param fd          socket fd
  * @param ip6_packet  Pointer to IPv6 header in packet
  * @param packetsize  Size of IPv6 packet
- * @return -1 : Some error occured
+ * @return -1 : Some error occurred
  *          0 : packet stored (NDP request sent - packet will be sent if
  *                             NDP response is received)
  *         >0 : packet sent   (number of transmitted bytes is returned)
diff --git a/lib/libnet/ipv6.h b/lib/libnet/ipv6.h
index c6b681d..3a00ee5 100644
--- a/lib/libnet/ipv6.h
+++ b/lib/libnet/ipv6.h
@@ -24,7 +24,7 @@ 
 #define IPV6_DEBUG_PRINT(format, ...)
 #endif
 
-#define IPV6_ADDR_LENGTH	 16 /* Size of IPv6 adress in bytes */
+#define IPV6_ADDR_LENGTH	 16 /* Size of IPv6 address in bytes */
 #define IPV6_LL_PREFIX		 0xFE80000000000000ULL
 #define IPV6_LL_PREFIX_MASK	 0xFFC0000000000000ULL
 #define IPV6_SOLIC_NODE_PREFIX   0xFF02000000000000ULL
@@ -52,7 +52,7 @@  typedef struct {
 
 /** \struct prefix_info
  *
- * List of Prefixes we have adresses from
+ * List of Prefixes we have addresses from
  * Used for internal purposes, information derived from prefix option
  * in Router Advertisements
  * See RFC 4861 section 4.6.2
@@ -121,7 +121,7 @@  struct parseip6_state {
 };
 
 /** \struct ip6_config
- * Stores flags wheter we use Stateless- or Stateful Autoconfiguration or DHCPv6
+ * Stores flags whether we use Stateless- or Stateful Autoconfiguration or DHCPv6
  */
 struct ip6_config {
 	uint8_t managed_mode:1,
@@ -160,7 +160,7 @@  struct prefix_info * ip6_create_prefix_info(void);
  *	and add it to our IPv6 address list */
 void * ip6_prefix2addr (ip6_addr_t prefix);
 
-/* Compare IPv6 adresses */
+/* Compare IPv6 addresses */
 int8_t ip6_cmp(ip6_addr_t ip_1, ip6_addr_t ip_2);
 
 /* Check if it is a link-local address */
diff --git a/lib/libnet/ndp.c b/lib/libnet/ndp.c
index 1c420d6..47b34b5 100644
--- a/lib/libnet/ndp.c
+++ b/lib/libnet/ndp.c
@@ -86,7 +86,7 @@  find_router(ip6_addr_t ip)
 
 /**
  * Find a router for a given host address
- * @param  ip - IPv6 address with the prefered prefix
+ * @param  ip - IPv6 address with the preferred prefix
  * @return pointer to router, or NULL if none is available
  */
 struct router *ipv6_get_default_router(ip6_addr_t ip)
diff --git a/lib/libnet/netload.c b/lib/libnet/netload.c
index ae169f3..7276b82 100644
--- a/lib/libnet/netload.c
+++ b/lib/libnet/netload.c
@@ -54,7 +54,7 @@  typedef struct {
 } obp_tftp_args_t;
 
 /**
- * Print error with preceeding error code
+ * Print error with preceding error code
  */
 static void netload_error(int errcode, const char *format, ...)
 {
@@ -556,7 +556,7 @@  int netload(char *buffer, int len, char *args_fs, unsigned alen)
 
 	/***********************************************************
 	 *
-	 * Initialize network stuff and retrieve boot informations
+	 * Initialize network stuff and retrieve boot information
 	 *
 	 ***********************************************************/
 
diff --git a/lib/libnet/tftp.c b/lib/libnet/tftp.c
index 9a5817a..c6f71df 100644
--- a/lib/libnet/tftp.c
+++ b/lib/libnet/tftp.c
@@ -155,7 +155,7 @@  static void send_rrq(int fd)
 }
 
 /**
- * send_ack - Sends a acknowlege package.
+ * send_ack - Sends a acknowledge package.
  *
  * @blckno: block number
  * @dport:  UDP destination port
@@ -657,7 +657,7 @@  int parse_tftp_args(char buffer[], char *server_ip, char filename[], int fd,
 		/* look for dns server name */
 		tmp1 = strchr(raw, '.');
 		if (tmp1 == NULL) {
-			printf("\n missing . seperator in %s\n", raw);
+			printf("\n missing . separator in %s\n", raw);
 			free(raw);
 			return -1;
 		}