]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix config bug related to port setting
authorMatthijs Mekking <matthijs@isc.org>
Wed, 26 Oct 2022 07:55:55 +0000 (09:55 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 27 Oct 2022 09:39:34 +0000 (11:39 +0200)
commit72d3bf8e4ed9c9ad189141e191ce1bcb2d3b9190
tree8f26bc0cf898fc8e5f687ba60ec83784b1b7c19d
parent622a499027b163b12d0ef8a7cefad1967fedb529
Fix config bug related to port setting

There are three levels there for the port value, with increasing
priority:

1. The default ports, defined by 'port' and 'tls-port' config options.
2. The primaries-level default port: primaries port <number>  { ... };
3. The primaries element-level port: primaries { <address> port
   <number>; ... };"

In 'named_config_getipandkeylist()', the 'def_port' and 'def_tlsport'
variables are extracted from level 1. The 'port' variable is extracted
from the level 2. Currently if that is unset, it defaults to the
default port ('def_port' or 'def_tlsport' depending on the transport
used), but overrides the level 2 port setting for the next primaries in
the list.

Update the code such that we inherit the port only if the level 3 port
is not set, and inherit from the default ports if the level 2 port is
also not set.
bin/named/config.c