[ovs-dev,v2,ovn] fix default L4 default proto reported by ovn-nbctl
diff mbox series

Message ID 00204dd9b7c0fefcfa81912e8391130f19d014f8.1565000537.git.lorenzo.bianconi@redhat.com
State New
Headers show
Series
  • [ovs-dev,v2,ovn] fix default L4 default proto reported by ovn-nbctl
Related show

Commit Message

Lorenzo Bianconi Aug. 5, 2019, 10:24 a.m. UTC
If no protcol is specified defining a load balancing rule TCP is
selected as defualt but ovn-nbctl lb-list reports 'tcp/udp' in this
case. Fix it reporting tcp in this case

Fixes: e2bfcad6cbb0 ("ovn-nbctl: Add LB commands")
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
Changes since v1:
- fix LB ovn-nbctl unit-tests
---
 tests/ovn-nbctl.at    | 24 ++++++++++++------------
 utilities/ovn-nbctl.c |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

Comments

Numan Siddique Aug. 5, 2019, 2:51 p.m. UTC | #1
On Mon, Aug 5, 2019 at 3:55 PM Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
wrote:

> If no protcol is specified defining a load balancing rule TCP is
> selected as defualt but ovn-nbctl lb-list reports 'tcp/udp' in this
> case. Fix it reporting tcp in this case
>
> Fixes: e2bfcad6cbb0 ("ovn-nbctl: Add LB commands")
> Acked-by: Dumitru Ceara <dceara@redhat.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
>

Thanks Lorenzo (and Dumitru). I applied this to master fixing a typo in the
commit message - s/defualt/default

Numan

---
> Changes since v1:
> - fix LB ovn-nbctl unit-tests
> ---
>  tests/ovn-nbctl.at    | 24 ++++++++++++------------
>  utilities/ovn-nbctl.c |  2 +-
>  2 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
> index a19e33f5e..cf06966ed 100644
> --- a/tests/ovn-nbctl.at
> +++ b/tests/ovn-nbctl.at
> @@ -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])
> @@ -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])
> @@ -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])
> @@ -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])
> @@ -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])
> @@ -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])
> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
> index ad999dd96..460ab5600 100644
> --- a/utilities/ovn-nbctl.c
> +++ b/utilities/ovn-nbctl.c
> @@ -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),
> --
> 2.21.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>

Patch
diff mbox series

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index a19e33f5e..cf06966ed 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -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])
@@ -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])
@@ -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])
@@ -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])
@@ -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])
@@ -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])
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index ad999dd96..460ab5600 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -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),