Hi Lewis,
Have you ever done this with a UDP package?
https://stackoverflow.com/questions/5281409/get-destination-address-of-a-received-udp-packet
Looks like you can't use recvfrom and have to switch to recvmsg to use IP_PKTINFO
I'll dig into the book again.
Thanks for reading.
Gavin.