[Swan-dev] no-port vs zero port

Paul Wouters paul at nohats.ca
Wed Sep 4 14:40:21 UTC 2019


>
>
>  New commits:
>  commit 4972d0201f054b6c5de8804a20fc56679a72c8bd
>  Author: Andrew Cagney <cagney at gnu.org>
>  Date:   Wed Sep 4 09:50:35 2019 -0400
>
>      ip: add jam_subnet_port() et.al., test
>
>      Note the long standing bug: because the port is stored as a uint16_t
>      in a sockaddr(1), it isn't possible to differentiate between no-port
>      and zero port.  Since this is going to replace:
>
>          "%s:%d", str_subnet(), subnet_hport()
>
>      it mimics that behaviour, at least for now (don't be fooled by the
>      preemptive hport<0 check).

Using 0 for protocols or ports always means "all of it" in IKE/IPsec and
never means "none". So this is not a bug that needs fixing.

Paul


More information about the Swan-dev mailing list