Skip to content

Commit

Permalink
netdev-vport: Mark netdev_vport_get_dpif_port() as OVS_WARN_UNUSED_RE…
Browse files Browse the repository at this point in the history
…SULT.

Ignoring the result of this function means that the caller is quite likely
blindly using the character array passed in, instead of the return value,
which leads to latent bugs.

This would have prevented one of the bugs fixed by commit "tunneling: Fix a
tunnel name display bug".

CC: Andy Zhou <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Andy Zhou <[email protected]>
  • Loading branch information
blp committed Jun 11, 2015
1 parent 2b7b142 commit cbc083e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/netdev-vport.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2011, 2013 Nicira, Inc.
* Copyright (c) 2010, 2011, 2013, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <stdbool.h>
#include <stddef.h>
#include "compiler.h"

struct dpif_netlink_vport;
struct dpif_flow_stats;
Expand Down Expand Up @@ -48,7 +49,8 @@ enum { NETDEV_VPORT_NAME_BUFSIZE = 16 };
enum { NETDEV_VPORT_NAME_BUFSIZE = 256 };
#endif
const char *netdev_vport_get_dpif_port(const struct netdev *,
char namebuf[], size_t bufsize);
char namebuf[], size_t bufsize)
OVS_WARN_UNUSED_RESULT;
char *netdev_vport_get_dpif_port_strdup(const struct netdev *);

#endif /* netdev-vport.h */

0 comments on commit cbc083e

Please sign in to comment.