"In a both a ROUTE_DISCOVERY and a ROUTE_REPLY packet, the name of the destination nick that is being searched for."
This has been fixed in the handout PDF above. (Note that this is not a critical fix, as the destination field is really unnecessary in the ROUTE_REPLY since you can already match it up with the ROUTE_DISCOVERY using the sequence number)
int optval = 1; setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&optval , sizeof(int)); /* check for errors! */
while (ready && (current_fd < max_fd)){
if (FD_ISSET(current_fd, &read_fds)){
service_client(current_fd);
ready --;
}
current_fd ++;
}
Should instead say:
while (ready && (current_fd < max_fd)){
if (current_fd != listen_sock && FD_ISSET(current_fd, &read_fds)){
service_client(current_fd);
ready --;
}
current_fd ++;
}
This has been fixed in the sample implementation above. Ignore this if you
didn't use the sample implementation.
clnt = new_client(new_sock, hent->h_name);Should instead say:
clnt = new_client(new_sock, hent ? hent->h_name : inet_ntoa(cltaddr.sin_addr));This is in case gethostbyaddr fails to find a mapping for the host ip address (which can happen if the client has a private IP address for example). This has been fixed in the sample code above. Ignore this if you didn't use the sample IRC server.
2. A route discovery packet should not traverse the same path more than once (i.e., it should not go in a loop)
This has been corrected in the above handout.
"In a ROUTE_DISCOVERY packet, the name of the destination node or document being searched for..."
This should instead say:
"In a ROUTE_DISCOVERY packet, the name of the destination nick being searched for..."
And the Path size field said:
"... This is incremented each time a new node ID or document is appended to the path field."
This should instead say:
"... This is incremented each time a new nodeID is appended to the path field."
Thanks to Ahmed Hussain for pointing this out. This has been fixed in the handout PDF above.
1 2 3 2 1 3 5 3 1 2 4 3 1 2 4 3 5 5 2 4 6 6 5It has been fixed in the new tarball (note: the original code was not changed, just the example in the documentation). Thanks to Ricardo Colon for pointing that out.