treewide: spell-fixes and new comments for extra clarification
authorPaul Donald <newtwen@gmail.com>
Tue, 9 Apr 2024 03:04:06 +0000 (05:04 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 7 May 2024 22:06:41 +0000 (00:06 +0200)
Fix some spell mistake and add new comments for extra clatification.

Signed-off-by: Paul Donald <newtwen@gmail.com>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
[ improve commit title ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
src/config.c
src/dhcpv4.c
src/dhcpv6-ia.c
src/ndp.c
src/netlink.c
src/router.c

index 1cd460808c3deea4f6865aa1525ec65b9dace31d..0368e74054ee62d0a146b199c04d8beb6d7c0c2d 100644 (file)
@@ -892,6 +892,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
        if ((c = tb[IFACE_ATTR_RA_DEFAULT]))
                iface->default_router = blobmsg_get_u32(c);
 
+       /* IFACE_ATTR_RA_MANAGEMENT aka ra_management is deprecated since 2019 */
        if (!tb[IFACE_ATTR_RA_FLAGS] && !tb[IFACE_ATTR_RA_SLAAC] &&
            (c = tb[IFACE_ATTR_RA_MANAGEMENT])) {
                switch (blobmsg_get_u32(c)) {
index 3191ff2cc473d53b2e296daf8afbb76e029c97cb..cb0484f63dd896e7a08c06e0c16a76edf211f8f4 100644 (file)
@@ -893,7 +893,7 @@ void dhcpv4_handle_msg(void *addr, void *data, size_t len,
                struct arpreq arp = {.arp_flags = ATF_COM};
 
                /*
-                * send reply to the newly (in this proccess) allocated IP
+                * send reply to the newly (in this process) allocated IP
                 */
                dest.sin_addr = reply.yiaddr;
                dest.sin_port = htons(DHCPV4_CLIENT_PORT);
index 39a316ac7ab51b876bf9feb9d05a6b90d34bf4c8..dde224d9808164ae6755df50f5c391522fa6b0ac 100644 (file)
@@ -1142,11 +1142,11 @@ static size_t build_ia(uint8_t *buf, size_t buflen, uint16_t status,
                }
 
                if (!INFINITE_VALID(a->valid_until))
-                       /* UINT32_MAX is considered as infinite leasetime */
+                       /* UINT32_MAX is RFC defined as infinite lease-time */
                        a->valid_until = (valid_lt == UINT32_MAX) ? 0 : valid_lt + now;
 
                if (!INFINITE_VALID(a->preferred_until))
-                       /* UINT32_MAX is considered as infinite leasetime */
+                       /* UINT32_MAX is RFC defined as infinite lease-time */
                        a->preferred_until = (preferred_lt == UINT32_MAX) ? 0 : preferred_lt + now;
 
                o_ia.t1 = htonl((preferred_lt == UINT32_MAX) ? preferred_lt : preferred_lt * 5 / 10);
@@ -1570,7 +1570,7 @@ ssize_t dhcpv6_ia_handle_IAs(uint8_t *buf, size_t buflen, struct interface *ifac
                                /* Set error status */
                                status = (is_pd) ? DHCPV6_STATUS_NOPREFIXAVAIL : DHCPV6_STATUS_NOADDRSAVAIL;
                        else if (hdr->msg_type == DHCPV6_MSG_REQUEST && !dhcpv6_ia_on_link(ia, a, iface)) {
-                               /* Send NOTONLINK staus for the IA */
+                               /* Send NOTONLINK status for the IA */
                                status = DHCPV6_STATUS_NOTONLINK;
                                assigned = false;
                        } else if (accept_reconf && assigned && !first &&
index dfbb1115c2126cf67bdb7c08674a5355fa84750c..0ec6fed5ff37ebb6446f5a2468226cf0d11cc7ec 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -39,7 +39,7 @@ static void setup_addr_for_relaying(struct in6_addr *addr, struct interface *ifa
 static void handle_solicit(void *addr, void *data, size_t len,
                struct interface *iface, void *dest);
 
-/* Filter ICMPv6 messages of type neighbor soliciation */
+/* Filter ICMPv6 messages of type neighbor solicitation */
 static struct sock_filter bpf[] = {
        BPF_STMT(BPF_LD | BPF_B | BPF_ABS, offsetof(struct ip6_hdr, ip6_nxt)),
        BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, IPPROTO_ICMPV6, 0, 3),
@@ -343,7 +343,7 @@ static void handle_solicit(void *addr, void *data, size_t len,
                return;
 
        if (len < sizeof(*ip6) + sizeof(*req))
-               return; // Invalid reqicitation
+               return; // Invalid total length
 
        if (IN6_IS_ADDR_LINKLOCAL(&req->nd_ns_target) ||
                        IN6_IS_ADDR_LOOPBACK(&req->nd_ns_target) ||
index c33e3eae55576dbea9134435a91801732ef0a2d1..368e69c44b3c9315e6fe863e0854eab627b3f1ae 100644 (file)
@@ -213,7 +213,7 @@ static void refresh_iface_addr6(int ifindex)
 
                        if (change) {
                                /*
-                                * Keep track on removed prefixes, so we could advertise them as invalid
+                                * Keep track of removed prefixes, so we could advertise them as invalid
                                 * for at least a couple of times.
                                 *
                                 * RFC7084 § 4.3 :
index b69feb32c0499c5854f4541002c609549b5ed165..146713e34ca2031bf9b3ad3d547de9234a3fc640 100644 (file)
@@ -668,7 +668,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                uint8_t *search_domain = iface->search;
                uint8_t search_buf[256];
 
-               /* DNS Recursive DNS */
+               /* DNS Recursive DNS aka RDNSS Type 25; RFC8106 */
                if (iface->dns_cnt > 0) {
                        dns_addr = iface->dns;
                        dns_cnt = iface->dns_cnt;
@@ -688,7 +688,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
                        memcpy(dns->addr, dns_addr, sizeof(struct in6_addr)*dns_cnt);
                }
 
-               /* DNS Search options */
+               /* DNS Search options aka DNSSL Type 31; RFC8106 */
                if (!search_domain && !res_init() && _res.dnsrch[0] && _res.dnsrch[0][0]) {
                        int len = dn_comp(_res.dnsrch[0], search_buf,
                                        sizeof(search_buf), NULL, NULL);
@@ -719,7 +719,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
        iov[IOV_RA_SEARCH].iov_len = search_sz;
 
        if (iface->pref64_length) {
-               /* RFC 8781 § 4.1 rounding up lifetime to multiply of 8 */
+               /* RFC 8781 § 4.1 rounding up lifetime to multiple of 8 */
                uint16_t pref64_lifetime = lifetime < (UINT16_MAX - 7) ? lifetime + 7 : UINT16_MAX;
                uint8_t prefix_length_code;
                uint32_t mask_a1, mask_a2;