From: Yunjian Wang <wangyunj...@huawei.com>

The length check is wrong for immediate arguments to "execute" packet.
The ethernet header length should be considered.

Signed-off-by: Yunjian Wang <wangyunj...@huawei.com>
---
 lib/dpif-netdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 9fb82cc..6522f27 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3632,9 +3632,11 @@ dpif_netdev_execute(struct dpif *dpif, struct 
dpif_execute *execute)
     struct dp_netdev *dp = get_dp_netdev(dpif);
     struct dp_netdev_pmd_thread *pmd;
     struct dp_packet_batch pp;
+    int n_vlan = flow_count_vlan_headers(execute->flow);
 
     if (dp_packet_size(execute->packet) < ETH_HEADER_LEN ||
-        dp_packet_size(execute->packet) > UINT16_MAX) {
+        dp_packet_size(execute->packet) > UINT16_MAX +
+        ETH_HEADER_LEN + VLAN_HEADER_LEN * n_vlan) {
         return EINVAL;
     }
 
-- 
1.8.3.1


_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to