Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dpif-netdev: Fix crash when add dp flow without in_port field.
Userspace datapath relies on fact that every datapath flow has exact match on the in_port, but flows without in_port match could be added directly via dpctl commands. Even though dpctl is a debug interface, datapath should just reject such flows instead of crashing on assertion. Fix the following crash and add a unit test for this issue to tests/dpif-netdev.at: $ ovs-appctl dpctl/add-flow "eth(),eth_type(0x0800),ipv4()" "3" unixctl|WARN|error communicating with unix:ovs-vswitchd.ctl: End of file ovs-appctl: ovs-vswitchd: transaction error (End of file) ovs-vswitchd.log record: util(ovs-vswitchd)|EMER|lib/dpif-netdev.c:3638: assertion match->wc.masks.in_port.odp_port == ODPP_NONE failed in dp_netdev_flow_add() daemon_unix(monitor)|ERR|2 crashes: pid 1995 died, killed (Aborted), core dumped, restarting Fix result: $ ovs-appctl dpctl/add-flow "eth(),eth_type(0x0800),ipv4()" "3" ovs-vswitchd: updating flow table (Invalid argument) ovs-appctl: ovs-vswitchd: server returned an error ovs-vswitchd.log record: dpif_netdev|ERR|failed to put[create] flow: in_port is not an exact match dpif|WARN|netdev@ovs-netdev: failed to put[create] (Invalid argument) ufid:7e...d1 eth(src=00..00,dst=00..00),eth_type(0x0800), ipv4(src=0.0.0.0/0.0.0.0,dst=0.0.0.0/0.0.0.0,proto=0/0,tos=0/0,ttl=0/0), actions:3 Signed-off-by: Mao YingMing <[email protected]> Signed-off-by: Ilya Maximets <[email protected]>
- Loading branch information