sonic-buildimage/files
Alexander Allen da7533aad4
[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-23 13:40:43 -07:00
..
Aboot [Arista] Fix dockerd issue on Arista platforms (#7376) 2021-04-20 14:55:14 -07:00
apt Add mirrors for reproducible build (#6813) 2021-02-18 14:59:52 +08:00
build_scripts [hostcfgd]: Add Ability To Configure Feature During Run-time (#6700) 2021-03-13 05:56:27 -08:00
build_templates [qos]: modify dot1p to tc mapping (#7661) 2021-05-20 10:36:39 -07: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-23 13:40:43 -07:00
initramfs-tools [kdump] Fix OOM events in crashkernel (#6447) 2021-02-02 01:55:09 -08:00
scripts [Supervisord] Deduplicate the alerting messages of critical processes from Supervisord. (#6849) 2021-02-25 14:35:29 -08:00
sshd [sshd]: Create /run/sshd under systemd using RuntimeDirectory 2020-04-17 04:51:51 +00:00