sonic-buildimage/files
Alexander Allen bd6096a018 [ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB (#7586)
Why I did it
Currently, there is a bug in the ntp.conf jinja2 template where it will ignore the src_intf directive in CONFIG_DB if there are multiple IP addresses associated with an interface. This code change fixes that bug and allows the template to select the correct source interface for NTP.

How I did it
I did this by modifying the macro in ntp.conf.j2 which determines if there is an ip address associated with an interface to set a state variable when it detects a valid interface entry in CONFIG_DB instead of outputting "true" directly (which could result in multiple "trues" outputted for interfaces with multiple valid IP addresses).

How to verify it
Add two ipv4 addresses to an interface in SONiC

Add the following configuration to config_db.json

{
"NTP": {
    "global": {
        "src_intf": "Ethernet1"
        }
    }
}
Replace Ethernet1 with the interface name of the one you assigned the IP addresses to.

Run sudo config reload -y

Open /etc/ntp.conf and verify that the following line exists

...
interface listen Ethernet1
...
The interface specified should be the one set in the previous steps.

Description for the changelog
[ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB
2021-05-27 22:29:01 +00:00
..
Aboot [Arista] Fix dockerd issue on Arista platforms (#7376) 2021-05-01 19:43:51 -07:00
apt Add mirrors for reproducible build (#6813) 2021-02-19 11:51:34 -08:00
build/versions [202012] BRCM SAI 4.3.3.5-3 Enable VFP-based subintf on td2 (#7728) 2021-05-27 15:11:03 -07:00
build_scripts [hostcfgd]: Add Ability To Configure Feature During Run-time (#6700) 2021-03-15 19:09:31 -07:00
build_templates [qos]: modify dot1p to tc mapping (#7661) 2021-05-24 22:25:47 +00:00
dhcp ZTP infrastructure changes to support DHCP discovery provisioning data (#3298) 2019-12-10 08:16:56 -08:00
docker Enabling ipv6 support on docker container network. This is needed (#5418) 2020-09-22 08:32:17 -07:00
image_config [ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB (#7586) 2021-05-27 22:29:01 +00:00
initramfs-tools [NVMe] Add NVMe SSD disc type support to installer.sh script (#6142) 2020-12-09 19:03:27 -08:00
scripts [Supervisord] Deduplicate the alerting messages of critical processes from Supervisord. (#6849) 2021-03-04 21:23:05 +00:00
sshd [sshd]: Create /run/sshd under systemd using RuntimeDirectory 2020-04-17 04:51:51 +00:00