28.8 Summary


Exercises

27.1

In our IPv4 source route example at the end of Section 27.3, what changes if we specify each intermediate node to the client with the -G option, instead of the -g option?

27.2

The length of the buffer specified to setsockopt for the IP_OPTIONS socket option must be a multiple of 4 bytes. What would we do if we did not place an NOP at the beginning of the buffer, as shown in Figure 27.1?

27.3

How does ping receive a source route when the IP record route option is used (described in Section 7.3 of TCPv1)?

27.4

In the example code from the rlogind server at the end of Section 27.3 that clears a received source route, why is the socket descriptor argument for getsockopt and setsockopt 0?

27.5

For many years , the code we showed at the end of Section 27.3 that clears a received source route looked like the following:

 
 optsize = 0; setsockopt (0, IPPROTO_IP, IP_OPTIONS, NULL, &optsize); 

What is wrong with this code? Does it matter?




UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net