From 7a786a468852fda6949486d9214755f5607ad51a Mon Sep 17 00:00:00 2001 From: Alejandro Leal Date: Fri, 3 Jul 2020 14:53:28 -0400 Subject: [PATCH] Updating some comments --- packet/cmdparse.c | 4 ++-- packet/construct_unix.c | 4 ++-- packet/probe.h | 2 +- packet/probe_cygwin.c | 6 +++--- packet/probe_unix.c | 2 +- packet/probe_unix.h | 2 +- packet/wait_unix.c | 2 +- test/packet_listen.c | 2 +- test/param.py | 2 +- test/probe.py | 6 +++--- ui/cmdpipe.c | 4 ++-- ui/dns.c | 2 +- ui/net.c | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packet/cmdparse.c b/packet/cmdparse.c index 76e6c91..85757b6 100644 --- a/packet/cmdparse.c +++ b/packet/cmdparse.c @@ -66,8 +66,8 @@ int tokenize_command( structure for later semantic interpretation. Returns EINVAL if the command string is unparseable or zero for success. - comamnd_string will be modified in-place with NUL characters terminating - tokens, and the command_t will use pointers to the conents of + command_string will be modified in-place with NUL characters terminating + tokens, and the command_t will use pointers to the contents of command_string without copying, so any interpretation of the command_t structure requires that the command_string memory has not yet been freed or otherwise reused. diff --git a/packet/construct_unix.c b/packet/construct_unix.c index 09250bc..dff17d8 100644 --- a/packet/construct_unix.c +++ b/packet/construct_unix.c @@ -724,7 +724,7 @@ int construct_ip6_packet( /* Check the current socket address, and if it is the same as the source address we intend, we will skip the bind. - This is to accomodate Solaris, which, as of Solaris 11.3, + This is to accommodate Solaris, which, as of Solaris 11.3, will return an EINVAL error on bind if the socket is already bound, even if the same address is used. */ @@ -754,7 +754,7 @@ int construct_ip6_packet( } } - /* The traffic class in IPv6 is analagous to ToS in IPv4 */ + /* The traffic class in IPv6 is analogous to ToS in IPv4 */ if (setsockopt(send_socket, IPPROTO_IPV6, IPV6_TCLASS, ¶m->type_of_service, sizeof(int))) { return -1; diff --git a/packet/probe.h b/packet/probe.h index 796eb71..e7b8bee 100644 --- a/packet/probe.h +++ b/packet/probe.h @@ -68,7 +68,7 @@ struct probe_param_t { /* The packet "mark" used for mark-based routing on Linux */ int routing_mark; - /* Time to live for the transmited probe */ + /* Time to live for the transmitted probe */ int ttl; /* The packet size (in bytes) including protocol headers */ diff --git a/packet/probe_cygwin.c b/packet/probe_cygwin.c index 039e2e3..ab477be 100644 --- a/packet/probe_cygwin.c +++ b/packet/probe_cygwin.c @@ -81,7 +81,7 @@ We use the Cygwin pipe() to create the pipes, but in the ICMP service thread we use the Win32 HANDLE that corresponds to the - recieving end of the input pipe to wait for ICMP requests. + receiving end of the input pipe to wait for ICMP requests. */ @@ -94,7 +94,7 @@ void init_net_state_privileged( } /* - Convienience similar to error(), but for reporting Windows + Convenience similar to error(), but for reporting Windows error codes instead of errno codes. */ void error_win(int exit_code, int win_error, const char *str) { @@ -717,7 +717,7 @@ void receive_replies( } /* - On Windows, an implementation of check_probe_timeout is unnecesary because + On Windows, an implementation of check_probe_timeout is unnecessary because timeouts are managed by ICMP.DLL, including a call to the I/O completion routine when the time fully expires. */ diff --git a/packet/probe_unix.c b/packet/probe_unix.c index a749f7d..e77e46f 100644 --- a/packet/probe_unix.c +++ b/packet/probe_unix.c @@ -692,7 +692,7 @@ void receive_probe( /* Read all available packets through our receiving raw socket, and - handle any responses to probes we have preivously sent. + handle any responses to probes we have previously sent. */ static void receive_replies_from_recv_socket( diff --git a/packet/probe_unix.h b/packet/probe_unix.h index cc01e1e..0ce7657 100644 --- a/packet/probe_unix.h +++ b/packet/probe_unix.h @@ -40,7 +40,7 @@ struct probe_platform_t { struct timeval departure_time; }; -/* We'll use rack sockets to send and recieve probes on Unix systems */ +/* We'll use rack sockets to send and receive probes on Unix systems */ struct net_state_platform_t { /* true if we were successful at opening IPv4 sockets */ bool ip4_present; diff --git a/packet/wait_unix.c b/packet/wait_unix.c index 06d2ea7..ad14238 100644 --- a/packet/wait_unix.c +++ b/packet/wait_unix.c @@ -104,7 +104,7 @@ int gather_read_fds( Sleep until we receive a new probe response, a new command on the command stream, or a probe timeout. On Unix systems, this means we use select to wait on file descriptors for the command stream - and the raw recieve socket. + and the raw receive socket. */ void wait_for_activity( struct command_buffer_t *command_buffer, diff --git a/test/packet_listen.c b/test/packet_listen.c index a822707..9a1d931 100644 --- a/test/packet_listen.c +++ b/test/packet_listen.c @@ -34,7 +34,7 @@ #define SEQUENCE_NUM 33000 /* - Check to see if the packet we've recieved is intended for this test + Check to see if the packet we've received is intended for this test process. We expected the ICMP sequence number to be equal to our process ID. */ diff --git a/test/param.py b/test/param.py index d220019..edb8f5c 100755 --- a/test/param.py +++ b/test/param.py @@ -62,7 +62,7 @@ class TestParameters(mtrpacket.MtrPacketTest): @unittest.skipIf(sys.platform == 'cygwin', 'No Cygwin test') class TestIPv6Parameters(mtrpacket.MtrPacketTest): - 'Test packet paramter customization for IPv6' + 'Test packet parameter customization for IPv6' @unittest.skipUnless(mtrpacket.HAVE_IPV6, 'No IPv6') def test_param(self): diff --git a/test/probe.py b/test/probe.py index e69214c..b1f0fff 100755 --- a/test/probe.py +++ b/test/probe.py @@ -208,7 +208,7 @@ class TestProbeICMPv4(mtrpacket.MtrPacketTest): def test_ttl_expired(self): 'Test sending a probe which will have its time-to-live expire' - # Probe Goolge's DNS server, but give the probe only one hop + # Probe Google's DNS server, but give the probe only one hop # to live. self.write_command('16 send-probe ip-4 8.8.8.8 ttl 1') reply = self.parse_reply() @@ -220,7 +220,7 @@ class TestProbeICMPv4(mtrpacket.MtrPacketTest): '''Test sending multiple probes in parallel We will expect the probes to complete out-of-order by sending - a probe to a distant host immeidately followed by a probe to + a probe to a distant host immediately followed by a probe to the local host.''' success_count = 0 @@ -300,7 +300,7 @@ class TestProbeICMPv6(mtrpacket.MtrPacketTest): def test_ttl_expired(self): 'Test sending a probe which will have its time-to-live expire' - # Probe Goolge's DNS server, but give the probe only one hop + # Probe Google's DNS server, but give the probe only one hop # to live. cmd = '53 send-probe ip-6 ' + self.google_addr + ' ttl 1' self.write_command(cmd) diff --git a/ui/cmdpipe.c b/ui/cmdpipe.c index 2119516..a919754 100644 --- a/ui/cmdpipe.c +++ b/ui/cmdpipe.c @@ -207,7 +207,7 @@ int check_packet_features( extern char *myname; /* - Execute mtr-packet, allowing the MTR_PACKET evironment to override + Execute mtr-packet, allowing the MTR_PACKET environment to override the PATH when locating the executable. */ static @@ -755,7 +755,7 @@ void consume_reply_buffer( /* Terminate the reply string at the newline, which is necessary in the case where we are able to read - mulitple replies arriving simultaneously. + multiple replies arriving simultaneously. */ *end_of_reply = 0; diff --git a/ui/dns.c b/ui/dns.c index b0bf1f2..7dc8885 100644 --- a/ui/dns.c +++ b/ui/dns.c @@ -150,7 +150,7 @@ void dns_open( error(EXIT_FAILURE, errno, "signal"); } - /* Close all unneccessary FDs. + /* Close all unnecessary FDs. for debugging and error reporting, keep std-in/out/err. */ for (i = 3; i < fromdns[1]; i++) { if (i == todns[0]) diff --git a/ui/net.c b/ui/net.c index 830d4ab..d2a38b6 100644 --- a/ui/net.c +++ b/ui/net.c @@ -546,7 +546,7 @@ int net_send_batch( have a range for "rand()" that runs to 32768, and the destination range is 10000, you end up with 4 out of 32768 0-2768's and only 3 out of 32768 for results 2769 .. 9999. - As our detination range (in the example 10000) is much + As our destination range (in the example 10000) is much smaller (reasonable packet sizes), and our rand() range much larger, this effect is insignificant. Oh! That other formula didn't work. */ -- 2.47.2