2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev-vport: Don't return static data in netdev_vport_get_dpif_port().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2013-05-01 11:05:28 -07:00
parent 3efb60637b
commit 3aa30359b1
5 changed files with 42 additions and 13 deletions

View File

@@ -484,7 +484,9 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
{
struct dpif_linux *dpif = dpif_linux_cast(dpif_);
const struct netdev_tunnel_config *tnl_cfg;
const char *name = netdev_vport_get_dpif_port(netdev);
char namebuf[NETDEV_VPORT_NAME_BUFSIZE];
const char *name = netdev_vport_get_dpif_port(netdev,
namebuf, sizeof namebuf);
const char *type = netdev_get_type(netdev);
struct dpif_linux_vport request, reply;
struct nl_sock *sock = NULL;