Description of problem: if set the lsp-addresses dynamic,the ip distributed was wrong when the subnet mask is set to CIDR that means when I config ovn-nbctl lsp-set-addresses vm1 "00:de:ad:01:00:01 dynamic" and set the ls subnet which netmask is not 8/16/24,like below, ovn-nbctl set logical_switch s1 other_config:subnet=42.42.42.0/25 the ip for the dynamic_addresses may get "42.42.42.127" or "42.42.42.128" but 42.42.42.128 is not belong to the subnet 42.42.42.0/25,and 42.42.42.127 can't be assign to a port as it is the broadcast ip for this subnet. Version-Release number of selected component (if applicable): # rpm -qa|grep ovn ovn2.13-20.06.1-6.el8fdp.x86_64 ovn2.13-host-20.06.1-6.el8fdp.x86_64 ovn2.13-central-20.06.1-6.el8fdp.x86_64 How reproducible: always Steps to Reproduce: ovn-nbctl ls-add s1 i=1 for m in `seq 0 4`;do for n in `seq 1 99`;do ovn-nbctl lsp-add s1 vm$i ovn-nbctl lsp-set-addresses vm$i "00:de:ad:01:$m:$n dynamic" let i++ if [ $i -gt 200 ];then break; fi done if [ $i -gt 200 ];then break; fi done ovn-nbctl set logical_switch s1 other_config:subnet=42.42.42.0/25 Actual results: # ovn-nbctl list logical-switch-port|grep 42.42.42.128\" dynamic_addresses : "00:de:ad:01:02:31 42.42.42.128" # ovn-nbctl list logical-switch-port|grep 42.42.42.127\" dynamic_addresses : "00:de:ad:01:00:65 42.42.42.127" Expected results: these two ip should not be distributed to the port Additional info:
try to reproduce this issue,you should change the subnet config. based on the env in the description,you should config "ovn-nbctl set logical_switch s1 other_config:subnet=42.42.42.0/24" first,and the dynamic addresses are correct. #ovn-nbctl list logical-switch-port|grep 42.42.42.127 # #ovn-nbctl list logical-switch-port|grep 42.42.42.128 # then, change the config "ovn-nbctl set logical_switch s1 other_config:subnet=42.42.42.0/25",now you can see the wrong results. #ovn-nbctl list logical-switch-port|grep 42.42.42.127 #dynamic_addresses : "00:de:ad:01:00:56 42.42.42.127" #ovn-nbctl list logical-switch-port|grep 42.42.42.128 #dynamic_addresses : "00:de:ad:01:00:77 42.42.42.128"
I run the case on the latest version: # rpm -qa|grep ovn ovn2.13-host-20.09.0-9.el8fdp.x86_64 ovn2.13-20.09.0-9.el8fdp.x86_64 ovn2.13-central-20.09.0-9.el8fdp.x86_64 :: [ 23:02:37 ] :: [ BEGIN ] :: Running 'ovn-nbctl list logical-switch-port|grep 42.42.42.127' dynamic_addresses : "00:de:ad:01:02:79 42.42.42.127" :: [ 23:02:37 ] :: [ PASS ] :: Command 'ovn-nbctl list logical-switch-port|grep 42.42.42.127' (Expected 0, got 0) :: [ 23:02:37 ] :: [ BEGIN ] :: Running 'ovn-nbctl list logical-switch-port|grep 42.42.42.128' dynamic_addresses : "00:de:ad:01:00:55 42.42.42.128" :: [ 23:02:37 ] :: [ PASS ] :: Command 'ovn-nbctl list logical-switch-port|grep 42.42.42.128' (Expected 0, got 0) :: [ 23:02:47 ] :: [ BEGIN ] :: Running 'ovn-nbctl list logical-switch-port|grep 42.42.42.127' :: [ 23:02:47 ] :: [ PASS ] :: Command 'ovn-nbctl list logical-switch-port|grep 42.42.42.127' (Expected 1, got 1) :: [ 23:02:47 ] :: [ BEGIN ] :: Running 'ovn-nbctl list logical-switch-port|grep 42.42.42.128' :: [ 23:02:47 ] :: [ PASS ] :: Command 'ovn-nbctl list logical-switch-port|grep 42.42.42.128' (Expected 1, got 1) job log on rhel8: https://beaker-archive.host.prod.eng.bos.redhat.com/beaker-logs/2020/11/47064/4706464/9019193/117359386/taskout.log job log on rhel7: https://beaker.engineering.redhat.com/recipes/9019916/tasks/117365782/logs/taskout.log
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (ovn2.13 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5308