]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commitdiff
netdev-vport: Free error string from str_to_u8() in tunnel config.
authorEelco Chaudron <echaudro@redhat.com>
Fri, 10 Oct 2025 16:09:58 +0000 (18:09 +0200)
committerEelco Chaudron <echaudro@redhat.com>
Wed, 15 Oct 2025 10:37:46 +0000 (12:37 +0200)
Free the error string returned by str_to_u8() in set_tunnel_config().
While at it, also add a proper error message for this error case.

Fixes: ebe0e518b048 ("tunnel: Bareudp Tunnel Support.")
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
lib/netdev-vport.c

index ed67b509d0ccb1445548ba8932cf97e73824ec67..d11269d00683d1a3b93dc22ed23244fd922c348c 100644 (file)
@@ -813,9 +813,13 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp)
                  tnl_cfg.exts |= (1 << OVS_BAREUDP_EXT_MULTIPROTO_MODE);
             } else {
                  uint16_t payload_ethertype;
+                 char *error = str_to_u16(node->value, "payload_type",
+                                          &payload_ethertype);
 
-                 if (str_to_u16(node->value, "payload_type",
-                                &payload_ethertype)) {
+                 if (error) {
+                     free(error);
+                     ds_put_format(&errors, "%s: bad %s 'payload_type'\n",
+                                   name, node->value);
                      err = EINVAL;
                      goto out;
                  }