set_tunnel_config() always logs a warning, even on success. This
shouldn't happen.
Without this, some unit tests fail.
Fixes: 9fff138ec3a6("netdev: Add 'errp' to set_config().")
Signed-off-by: Daniele Di Proietto <[email protected]>
---
lib/netdev-vport.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index ad5ffcc81..2db51df72 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -561,10 +561,12 @@ set_tunnel_config(struct netdev *dev_, const struct smap
*args, char **errp)
err = 0;
out:
- ds_chomp(&errors, '\n');
- VLOG_WARN("%s", ds_cstr(&errors));
- if (err) {
- *errp = ds_steal_cstr(&errors);
+ if (*ds_cstr(&errors)) {
+ ds_chomp(&errors, '\n');
+ VLOG_WARN("%s", ds_cstr(&errors));
+ if (err) {
+ *errp = ds_steal_cstr(&errors);
+ }
}
ds_destroy(&errors);
--
2.11.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev