Skip to content

Commit 5ed4170

Browse files
authored
[dhcp_relay] Remove wait LLA in wait_for_intf.sh in dhcp_relay container (sonic-net#21399)
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it There is wait in wait_for_intf.sh inside dhcp_relay container to wait all vlans' ipv6 link local address to be ready. Only after that, related dhcp relay processes could be started (i.e. dhcrelay, dhcp6relay, dhcpmon) If ipv6 link local address for one vlan is not ready, it would block all vlans' dhcpv4 and dhcpv6 relay, which is unexpected. ##### Work item tracking - Microsoft ADO **(number only)**: 30491632 #### How I did it With current PR, remove wait LLA logic in this script. Add wait LLA in dhcp6relay process sonic-net/sonic-dhcp-relay#52 (PR has been merged) #### How to verify it Install image and confirm <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent 66a3d23 commit 5ed4170

File tree

3 files changed

+0
-60
lines changed

3 files changed

+0
-60
lines changed

dockers/docker-dhcp-relay/wait_for_intf.sh.j2

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@ function wait_until_iface_ready
2121
echo "Interface ${IFACE_NAME} is ready!"
2222
}
2323

24-
function check_for_ipv6_link_local
25-
{
26-
IFACE_NAME=$1
27-
echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...."
28-
29-
# Status of link local address is not populated in STATE_DB
30-
while true; do
31-
HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null)
32-
RC=$?
33-
if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then
34-
break
35-
fi
36-
37-
sleep 1
38-
done
39-
40-
echo "Link-Local address is configured on ${IFACE_NAME}"
41-
}
42-
4324
# Wait for all interfaces with IPv4 addresses to be up and ready
4425
# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces
4526
# Thus check if they are ready before launching dhcp6relay
@@ -55,7 +36,6 @@ wait_until_iface_ready {{ name }} {{ prefix }}
5536
{% if prefix | ipv6 %}
5637
{% if DHCP_RELAY and name in DHCP_RELAY %}
5738
wait_until_iface_ready {{ name }} {{ prefix }}
58-
check_for_ipv6_link_local {{ name }}
5939
{% endif %}
6040
{% endif %}
6141
{% endfor %}

src/sonic-config-engine/tests/sample_output/py2/wait_for_intf.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,12 @@ function wait_until_iface_ready
2121
echo "Interface ${IFACE_NAME} is ready!"
2222
}
2323

24-
function check_for_ipv6_link_local
25-
{
26-
IFACE_NAME=$1
27-
echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...."
28-
29-
# Status of link local address is not populated in STATE_DB
30-
while true; do
31-
HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null)
32-
RC=$?
33-
if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then
34-
break
35-
fi
36-
37-
sleep 1
38-
done
39-
40-
echo "Link-Local address is configured on ${IFACE_NAME}"
41-
}
42-
4324
# Wait for all interfaces with IPv4 addresses to be up and ready
4425
# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces
4526
# Thus check if they are ready before launching dhcp6relay
4627
wait_until_iface_ready Vlan2000 192.168.200.1/27
4728
wait_until_iface_ready Vlan1000 192.168.0.1/27
4829
wait_until_iface_ready Vlan1000 fc02:2000::2/24
49-
check_for_ipv6_link_local Vlan1000
5030
wait_until_iface_ready PortChannel02 10.0.0.58/31
5131
wait_until_iface_ready PortChannel03 10.0.0.60/31
5232
wait_until_iface_ready PortChannel04 10.0.0.62/31

src/sonic-config-engine/tests/sample_output/py3/wait_for_intf.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,10 @@ function wait_until_iface_ready
2121
echo "Interface ${IFACE_NAME} is ready!"
2222
}
2323

24-
function check_for_ipv6_link_local
25-
{
26-
IFACE_NAME=$1
27-
echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...."
28-
29-
# Status of link local address is not populated in STATE_DB
30-
while true; do
31-
HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null)
32-
RC=$?
33-
if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then
34-
break
35-
fi
36-
37-
sleep 1
38-
done
39-
40-
echo "Link-Local address is configured on ${IFACE_NAME}"
41-
}
42-
4324
# Wait for all interfaces with IPv4 addresses to be up and ready
4425
# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces
4526
# Thus check if they are ready before launching dhcp6relay
4627
wait_until_iface_ready Vlan1000 fc02:2000::2/24
47-
check_for_ipv6_link_local Vlan1000
4828
wait_until_iface_ready Vlan1000 192.168.0.1/27
4929
wait_until_iface_ready Vlan2000 192.168.200.1/27
5030
wait_until_iface_ready PortChannel01 10.0.0.56/31

0 commit comments

Comments
 (0)