[ Team LiB ] Previous Section Next Section

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?


    [ Team LiB ] Previous Section Next Section