chiark / gitweb /
udp, polypath: Make specifying port optional
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 1 Oct 2014 23:19:34 +0000 (00:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 9 Oct 2014 18:30:00 +0000 (19:30 +0100)
commit3fee817d723bfeeeacebe9567263f6d20885944a
treeac6b68de48c73548d133df67f023060bb04613c0
parentaa11e095dac35c4914bcd4965ff4ee03b2a154b7
udp, polypath: Make specifying port optional

There is no particular reason why a mobile site with no stable address
ought to have to bind to a particular port.  Doing so in those
configurations can bring in additional complications.

So, make specifying the port optional.

udp_make_socket calls getsockname to find what port number it got.
(We do this unconditionally as that's simplest.)

This has more complicated fallout than appears at first glance.
polypath needs to be able to match disappearances of the interface
address, which is mostly processed in terms of the configured rather
than obtained sockaddr.

In polypath, we need to compare just the addresses when removing an
interface address, because the port will have been assigned later.  We
also use the actual address in logging, rather than the one supplied
by the interface monitor.

To support these changes, we formalise udp_import_socket, and provide
a new `ignoreport' option to iaddr_equal.  The scope of the FAIL and
FAIL_LG macros in udp.c becomes a bit wider.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
comm-common.h
polypath.c
secnet.h
udp.c
util.c