diff options
author | Ben Pfaff <blp@nicira.com> | 2013-07-09 09:23:02 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-07-11 10:33:35 -0700 |
commit | 586ddea56b4dc74f45a6b0eec7e20f503a0d2c76 (patch) | |
tree | e9fb1b5093716c923205149ae52d3ed48431a94b /lib/dpif-netdev.c | |
parent | 0af7e5ace1d41261c78e4c97e1d6d51b0088db3e (diff) |
dpif-netdev: Make "packet-out" with in_port=OFPP_CONTROLLER work again.
Commit 4e022ec09e14 (Create specific types for ofp and odp port) broke
OpenFlow OFPP_PACKET_OUT requests that use in_port=OFPP_CONTROLLER. This
commit fixes the problem and adds a regression test.
CC: Alex Wang <alexw@nicira.com>
Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r-- | lib/dpif-netdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index f8f1f881..f7e3b1ff 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -694,6 +694,8 @@ static int dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len, struct flow *flow) { + odp_port_t in_port; + if (odp_flow_key_to_flow(key, key_len, flow) != ODP_FIT_PERFECT) { /* This should not happen: it indicates that odp_flow_key_from_flow() * and odp_flow_key_to_flow() disagree on the acceptable form of a @@ -713,7 +715,8 @@ dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len, return EINVAL; } - if (!is_valid_port_number(flow->in_port.odp_port)) { + in_port = flow->in_port.odp_port; + if (!is_valid_port_number(in_port) && in_port != ODPP_NONE) { return EINVAL; } |