sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
746 stars 1.44k forks source link

[DHCP Relay ipv4] | There is no ip verification in cli commands "config vlan dhcp_relay add" #7687

Open Hedgehog-Guru opened 3 years ago

Hedgehog-Guru commented 3 years ago

Description There is no ip verification in cli commands

Steps to reproduce the issue 1) Create vlan

2) Run cli command

config vlan dhcp_relay add 300 300

3) Observe vlan brief configuration

Describe the results you received Wrong DHCP Helper Address asigned

root@r-qa-sw-eth-20162:/home/admin# config vlan dhcp_relay add 300 300
Added DHCP relay destination address 300 to Vlan300
Restarting DHCP relay service...
root@r-qa-sw-eth-20162:/home/admin# show vlan br
+-----------+--------------------+-------------+----------------+-----------------------+-------------+
|   VLAN ID | IP Address         | Ports       | Port Tagging   | DHCP Helper Address   | Proxy ARP   |
+===========+====================+=============+================+=======================+=============+
|       300 | 101.1.0.1/24       | Ethernet224 | untagged       | 100.1.4.2             | disabled    |
|           | 192.168.4.1/24     | Ethernet248 | untagged       | 100.1.0.2             |             |
|           | 2000:0:1:1::1/64   |             |                | 300                   |             | <-------HERE IS WRONG IP ADDRESS
|           | 2000:0:1:1::1:1/64 |             |                | 2000:1::2             |             |

Describe the results you expected IP address verification should be included in dhcp_relay command. For example:

root@r-qa-sw-eth-20162:/home/admin# config vlan dhcp_relay add 300 300

300 is not an ip address <------ EXPECTED OUTPUT LIKE THIS (ERROR MESSAGE)

Output of show version

SONiC Software Version: SONiC.shlomi_dhcpv6_relay_qa.1-1a5b44e_Internal
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: 1a5b44ef
Build date: Thu May 13 11:25:58 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02

Platform: x86_64-mlnx_msn4700-r0
HwSKU: ACS-MSN4700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2015X25486

sonic_dump_r-qa-sw-eth-20162_20210519_124140.tar.gz

anshuv-mfst commented 3 years ago

Need help from community for proposing fix

shlomibitton commented 3 years ago

@anshuv-mfst I fixed this issue and will publish a PR for it once this PR will merge: https://github.com/Azure/sonic-buildimage/pull/6531