Skip to content

[ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB#5

Closed
alexrallen wants to merge 1 commit intomasterfrom
fix_ntp
Closed

[ntp] Fix ntp.conf template to allow setting of source port in CONFIG_DB#5
alexrallen wants to merge 1 commit intomasterfrom
fix_ntp

Conversation

@alexrallen
Copy link
Copy Markdown
Owner

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

  1. Add two ipv4 addresses to an interface in SONiC

  2. 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.

  1. Run sudo config reload -y

  2. 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

A picture of a cute animal (not mandatory but encouraged)

Light-Gray-German-Angora-Rabbit_Hidden-Springs-Farm_Shutterstock-e1612565280404

@alexrallen alexrallen requested a review from liat-grozovik May 6, 2021 16:48
@liat-grozovik
Copy link
Copy Markdown
Collaborator

thanks. if CI is passing lets go with upstreaming it.

@alexrallen alexrallen closed this May 12, 2021
alexrallen pushed a commit that referenced this pull request Oct 29, 2021
Also add out of tree pca9548 mux driver to use platform data to mapping i2c bus with front panel port.

Signed-off-by: Jakkapan Jangmuang <jjangmua@celestica.com>

Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
alexrallen pushed a commit that referenced this pull request Nov 5, 2021
Also add out of tree pca9548 mux driver to use platform data to mapping i2c bus with front panel port.

Signed-off-by: Jakkapan Jangmuang <jjangmua@celestica.com>

Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
alexrallen pushed a commit that referenced this pull request Nov 17, 2021
Also add out of tree pca9548 mux driver to use platform data to mapping i2c bus with front panel port.

Signed-off-by: Jakkapan Jangmuang <jjangmua@celestica.com>

Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
alexrallen pushed a commit that referenced this pull request Dec 8, 2021
#### What I did 

[sonic-linkmgrd][master] submodule update

6c6151b Fix unstable unit tests (state change handler wasn't invoked) (#8)
2f7dc0a support code diff coverage (#5)
83f0002 Force mux state switch to standby if triggered from Cli (#6)

signed-off-by: Jing Zhang zhangjing@microsoft.com
alexrallen pushed a commit that referenced this pull request Mar 30, 2022
6c6151b Fix unstable unit tests (state change handler wasn't invoked) (#8)
2f7dc0a support code diff coverage (#5)
83f0002 Force mux state switch to standby if triggered from Cli (#6)

signed-off-by: Jing Zhang zhangjing@microsoft.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants