diff options
author | Justin Pettit <jpettit@nicira.com> | 2012-10-17 23:11:53 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2012-11-01 22:54:27 -0700 |
commit | 4afba28d559511a5ee03e005b65be8323bf26ad3 (patch) | |
tree | dbb02334b5ade65c8545209e9b05074ba28fb20d /lib/dpif-netdev.c | |
parent | 11a574a737fa506c8e66c7bd42fa3186e70c286f (diff) |
dpif: Add new dpif_port_exists() function.
Provide the ability to determine whether a port exists in a datapath
without having to deal with a "dpif_port" structure as with
dpif_port_query_by_name(). A future patch will use this function.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r-- | lib/dpif-netdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 7f91f48b..a80b1b06 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -522,7 +522,7 @@ dpif_netdev_port_query_by_number(const struct dpif *dpif, uint32_t port_no, int error; error = get_port_by_number(dp, port_no, &port); - if (!error) { + if (!error && dpif_port) { answer_port_query(port, dpif_port); } return error; @@ -537,7 +537,7 @@ dpif_netdev_port_query_by_name(const struct dpif *dpif, const char *devname, int error; error = get_port_by_name(dp, devname, &port); - if (!error) { + if (!error && dpif_port) { answer_port_query(port, dpif_port); } return error; |