Skip to content

Commit

Permalink
OVN: fix default L4 default proto reported by ovn-nbctl
Browse files Browse the repository at this point in the history
If no protcol is specified defining a load balancing rule TCP is
selected as default but ovn-nbctl lb-list reports 'tcp/udp' in this
case. Fix it reporting tcp in this case

Fixes: e2bfcad ("ovn-nbctl: Add LB commands")
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Justin Pettit <jpettit@ovn.org>

(cherry picked from ovn repo commit 04e10d1)
  • Loading branch information
LorenzoBianconi authored and justinpettit committed Aug 8, 2019
1 parent 5a9ee88 commit 1488821
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ovn/utilities/ovn-nbctl.c
Expand Up @@ -2864,7 +2864,7 @@ lb_info_add_smap(const struct nbrec_load_balancer *lb,
continue;
}

char *protocol = ss_get_port(&ss) ? lb->protocol : "tcp/udp";
char *protocol = ss_get_port(&ss) ? lb->protocol : "tcp";
i == 0 ? ds_put_format(&val,
UUID_FMT " %-20.16s%-11.7s%-*.*s%s",
UUID_ARGS(&lb->header_.uuid),
Expand Down
24 changes: 12 additions & 12 deletions tests/ovn-nbctl.at
Expand Up @@ -657,8 +657,8 @@ AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:8080
<2> lb2 tcp/udp 30.0.0.30 192.168.10.10
<3> lb3 tcp/udp 30.0.0.30 192.168.10.10
<2> lb2 tcp 30.0.0.30 192.168.10.10
<3> lb3 tcp 30.0.0.30 192.168.10.10
])
AT_CHECK([ovn-nbctl lb-del lb2 30.0.0.30])
AT_CHECK([ovn-nbctl lb-del lb3 30.0.0.30])
Expand Down Expand Up @@ -710,14 +710,14 @@ AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<2> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20
<2> lb3 tcp 30.0.0.10 192.168.10.10,192.168.10.20
])

AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0])
AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<1> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20
<1> lb3 tcp 30.0.0.10 192.168.10.10,192.168.10.20
])

AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1])
Expand Down Expand Up @@ -746,14 +746,14 @@ AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<1> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<2> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20
<2> lb3 tcp 30.0.0.10 192.168.10.10,192.168.10.20
])

AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0])
AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb1 udp 30.0.0.10:80 192.168.10.10:80,192.168.10.20:80
<1> lb3 tcp/udp 30.0.0.10 192.168.10.10,192.168.10.20
<1> lb3 tcp 30.0.0.10 192.168.10.10,192.168.10.20
])

AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1])
Expand Down Expand Up @@ -924,8 +924,8 @@ AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:8080
<2> lb2 tcp/udp ae0f::30 fd0f::10
<3> lb3 tcp/udp ae0f::30 fd0f::10
<2> lb2 tcp ae0f::30 fd0f::10
<3> lb3 tcp ae0f::30 fd0f::10
])
AT_CHECK([ovn-nbctl lb-del lb2 ae0f::30])
AT_CHECK([ovn-nbctl lb-del lb3 ae0f::30])
Expand Down Expand Up @@ -977,14 +977,14 @@ AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<2> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20
<2> lb3 tcp ae0f::10 fd0f::10,fd0f::20
])

AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0])
AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<1> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20
<1> lb3 tcp ae0f::10 fd0f::10,fd0f::20
])

AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1])
Expand Down Expand Up @@ -1013,14 +1013,14 @@ AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb0 tcp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<1> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<2> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20
<2> lb3 tcp ae0f::10 fd0f::10,fd0f::20
])

AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0])
AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
UUID LB PROTO VIP IPs
<0> lb1 udp [[ae0f::10]]:80 [[fd0f::10]]:80,[[fd0f::20]]:80
<1> lb3 tcp/udp ae0f::10 fd0f::10,fd0f::20
<1> lb3 tcp ae0f::10 fd0f::10,fd0f::20
])

AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1])
Expand Down

0 comments on commit 1488821

Please sign in to comment.