Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DHCP_RELAY] Updated wait_for_intf.sh to wait for ipv6 global and link local addr #35

Closed
wants to merge 4 commits into from

Conversation

vivekrnv
Copy link
Owner

@vivekrnv vivekrnv commented Oct 4, 2022

Signed-off-by: Vivek Reddy Karri vkarri@nvidia.com

Why I did it

Fixes https://github.com/sonic-net/sonic-buildimage/issues/11431

How I did it

How to verify it

  • Unit Tests
  • Tested on a live device
root@r-lionfish-16:/home/admin# redis-cli -n 4 hgetall "DHCP_RELAY|Vlan10"
1) "dhcpv6_servers@"
2) "fc01:2000::1"
root@r-lionfish-16:/home/admin# redis-cli -n 4 hgetall "VLAN|Vlan10"
1) "vlanid"
2) "10"
3) "dhcpv6_servers@"
4) "fc02:2000::1"
root@r-lionfish-16:/home/admin# ip addr show Vlan10
137: Vlan10@Bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP group default qlen 1000
    link/ether 1c:34:da:1c:9f:00 brd ff:ff:ff:ff:ff:ff
    inet6 fc02:2000::2/24 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1e34:daff:fe1c:9f00/64 scope link
       valid_lft forever preferred_lft forever
root@r-lionfish-16:/home/admin# systemctl restart dhcp_relay

Syslog:

Oct  4 03:41:44.255907 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:41:44,255 INFO spawned: 'start' with pid 18
Oct  4 03:41:44.256812 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:41:44,256 INFO success: start entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Oct  4 03:41:44.269321 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:41:44,268 INFO exited: dhcpmon-Vlan10 (exit status 0; not expected)
Oct  4 03:41:44.504875 r-lionfish-16 INFO dhcp_relay#supervisord: start Waiting until interface Vlan10 is ready...
Oct  4 03:41:44.509125 r-lionfish-16 INFO dhcp_relay#supervisord: start Interface Vlan10 is ready!
Oct  4 03:41:44.509125 r-lionfish-16 INFO dhcp_relay#supervisord: start Waiting until interface Vlan10 has a link-local ipv6 address configured....
Oct  4 03:41:44.512623 r-lionfish-16 INFO dhcp_relay#supervisord: start Link-Local address is configured on Vlan10
root@r-lionfish-16:/home/admin# docker exec -it dhcp_relay cat /usr/bin/wait_for_intf.sh
#!/usr/bin/env bash
.............................

function check_for_ipv6_link_local
{
    IFACE_NAME=$1
    echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...."

    # Status of link local address is not populated in STATE_DB
    while true; do
        HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null)
        RC=$?
        if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then
            break
        fi

        sleep 1
    done

    echo "Link-Local address is configured on ${IFACE_NAME}"
}

# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces
# Thus check if they are ready before launching dhcp6relay
wait_until_iface_ready Vlan10 fc02:2000::2/24
check_for_ipv6_link_local Vlan10
..........

Negative Test: Remove link local address on Vlan iface and add it back

root@r-lionfish-16:/home/admin# ip addr del fe80::1e34:daff:fe1c:9f00/64 dev Vlan10
root@r-lionfish-16:/home/admin# ip addr show Vlan10
137: Vlan10@Bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP group default qlen 1000
    link/ether 1c:34:da:1c:9f:00 brd ff:ff:ff:ff:ff:ff
    inet6 fc02:2000::2/24 scope global
       valid_lft forever preferred_lft forever
root@r-lionfish-16:/home/admin# systemctl restart dhcp_relay

root@r-lionfish-16:/home/admin# show logging -f | grep dhcp_relay
Oct  4 03:51:54.661081 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:51:54,659 INFO spawned: 'start' with pid 20
Oct  4 03:51:54.661081 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:51:54,660 INFO success: start entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Oct  4 03:51:54.662736 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:51:54,662 INFO exited: dhcpmon-Vlan10 (exit status 0; not expected)
Oct  4 03:51:54.895207 r-lionfish-16 INFO dhcp_relay#supervisord: start Waiting until interface Vlan10 is ready...
Oct  4 03:51:54.899206 r-lionfish-16 INFO dhcp_relay#supervisord: start Interface Vlan10 is ready!
Oct  4 03:51:54.899535 r-lionfish-16 INFO dhcp_relay#supervisord: start Waiting until interface Vlan10 has a link-local ipv6 address configured....


root@r-lionfish-16:/home/admin# docker exec -it dhcp_relay supervisorctl status
dependent-startup                RUNNING   pid 12, uptime 0:01:20

root@r-lionfish-16:/home/admin# ip addr add fe80::1e34:daff:fe1c:9f00/64 dev Vlan10 scope link
root@r-lionfish-16:/home/admin#
Oct  4 03:54:37.641777 r-lionfish-16 INFO dhcp_relay#supervisord: start Link-Local address is configured on Vlan10
Oct  4 03:54:47.644881 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:54:47,644 INFO exited: start (exit status 0; expected)
Oct  4 03:54:48.674002 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:54:48,672 INFO spawned: 'dhcp6relay' with pid 539
Oct  4 03:54:48.683344 r-lionfish-16 DEBUG dhcp_relay#dhcp6relay: key: Vlan10, Operation: SET, f: dhcpv6_servers, v: fc01:2000::1
Oct  4 03:54:49.693668 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:54:49,692 INFO success: dhcp6relay entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Oct  4 03:54:50.763750 r-lionfish-16 INFO dhcp_relay#supervisord 2022-10-04 00:54:50,762 INFO exited: dependent-startup (exit status 0; expected)

root@r-lionfish-16:/home/admin# docker exec -it dhcp_relay supervisorctl status
dependent-startup                EXITED    Oct 04 12:54 AM
dhcp-relay:dhcp6relay            RUNNING   pid 539, uptime 0:00:52
........
start                            EXITED    Oct 04 12:54 AM

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

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

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
@vivekrnv vivekrnv marked this pull request as ready for review October 4, 2022 01:09
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
@vivekrnv vivekrnv closed this Oct 5, 2022
vivekrnv pushed a commit that referenced this pull request Feb 3, 2023
Why I did it
[FIPS] Upgrade Open-SymCrypt version to 0.6

Improve the SymCrypt performance
Support to download the debug packages from storage account in version 0.6.
How I did it
Upgrade to symcrypt-openssl from version 0.4 to version 0.6

Changes in https://github.com/sonic-net/sonic-fips:
0c29b23 Upgrade the submodules: SymCrypt and SymCrypt-OpenSSL #40
80022f3 Fix the ARM64 build failure
2e76a3d Disable the unsupported tests

Other changes will be added as well:
55b8e0a Merge pull request #35 from xumia/change-license
120c1a7 Upgrade SymCrypt and SymCrypt-OpenSSL
2f9c084 Merge pull request #39 from liuh-80/dev/liuh/update-openssh-version
a3be6c5 Revert openssh version
e02fa1e Update fips version

How to verify it
vivekrnv pushed a commit that referenced this pull request Mar 13, 2023
Why I did it
[FIPS] Upgrade Open-SymCrypt version to 0.6

Improve the SymCrypt performance
Support to download the debug packages from storage account in version 0.6.
How I did it
Upgrade to symcrypt-openssl from version 0.4 to version 0.6

Changes in https://github.com/sonic-net/sonic-fips:
0c29b23 Upgrade the submodules: SymCrypt and SymCrypt-OpenSSL #40
80022f3 Fix the ARM64 build failure
2e76a3d Disable the unsupported tests

Other changes will be added as well:
55b8e0a Merge pull request #35 from xumia/change-license
120c1a7 Upgrade SymCrypt and SymCrypt-OpenSSL
2f9c084 Merge pull request #39 from liuh-80/dev/liuh/update-openssh-version
a3be6c5 Revert openssh version
e02fa1e Update fips version

How to verify it
vivekrnv pushed a commit that referenced this pull request Mar 13, 2023
Why I did it
[FIPS] Upgrade Open-SymCrypt version to 0.6

Improve the SymCrypt performance
Support to download the debug packages from storage account in version 0.6.
How I did it
Upgrade to symcrypt-openssl from version 0.4 to version 0.6

Changes in https://github.com/sonic-net/sonic-fips:
0c29b23 Upgrade the submodules: SymCrypt and SymCrypt-OpenSSL #40
80022f3 Fix the ARM64 build failure
2e76a3d Disable the unsupported tests

Other changes will be added as well:
55b8e0a Merge pull request #35 from xumia/change-license
120c1a7 Upgrade SymCrypt and SymCrypt-OpenSSL
2f9c084 Merge pull request #39 from liuh-80/dev/liuh/update-openssh-version
a3be6c5 Revert openssh version
e02fa1e Update fips version

How to verify it
vivekrnv added a commit that referenced this pull request Mar 30, 2023
67a3bdf show counters wrong cli output fixed (#36)
5b3eea1 Update package cache, and bail on the first error (#35)
1d221b0 dhcpv6 relay UT code coverage improve (#32)
514b084 dhcpv6 packet handling code refine (#30)

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
vivekrnv pushed a commit that referenced this pull request Feb 10, 2024
…tomatically (sonic-net#17953)

#### Why I did it
src/sonic-platform-pde
```
* f2cc748 - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #35 from nonodark/local (21 hours ago) [賓少鈺]
* 607e920 - Fix 'Chassis' object has no attribute 'get_num_psu' in test_psu.py (3 weeks ago) [nonodark]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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.

2 participants