Patches from Alec Peterson, plus some work of my own, to let a multihomed
KDC respond to requests from the same IP address that the requests were sent
to.
**N.B. This will perform worse in the case of addresses dynamically added
and removed after the KDC has started, since it will be incapable of using
any new addresses.
I'm unclear on why the loopback interface address needs to be included in
the list of addresses. Apparently, on NetBSD-current, if it's not, packets
sent to other local addresses but over the loopback interface are queued but
not received?? Needs further investigation; could just be a NetBSD bug.
* configure.in: Invoke KRB5_SOCKADDR_SA_LEN.
* network.c: Include <sys/ioctl.h>, <syslog.h>, <net/if.h>.
(foreach_localaddr): New function, copied from
lib/krb5/os/localaddr.c. Tweaked to not exclude loopback
interface.
(NEED_SOCKETS): Define before including k5-int.h.
(n_sockets): New variable.
(setup_port): New function; creates listening udp ports given an
address.
(setup_network): Call foreach_localaddr to set up listening
sockets on each local address, so we can always respond from the
receiving address.
(listen_and_process): Use n_sockets as upper bound of loop.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12070
dc483132-0cff-0310-8789-
dd5450dbe970