Include sys/socket.h

Seems to be necessary on some BSDs

Signed-off-by: Jens Georg <mail@jensge.org>
Use pktinfo on Linux to determine source if

For other systems we use the old approach of comparing networks.

https://bugzilla.gnome.org/show_bug.cgi?id=711320

Signed-off-by: Jens Georg <mail@jensge.org>