openvswitch: Relax set header validation.
authorJesse Gross <jesse@nicira.com>
Mon, 6 Aug 2012 22:49:47 +0000 (15:49 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 6 Aug 2012 22:49:47 +0000 (15:49 -0700)
commit4185392da4b4b494e51934c51b999b4df424afba
treed007cf7c590f1f74674db208099ca772f90f2d5c
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee
openvswitch: Relax set header validation.

When installing a flow with an action to set a particular field we
need to validate that the packets that are part of the flow actually
contain that header.  With IP we use zeroed addresses and with TCP/UDP
the check is for zeroed ports.  This check is overly broad and can catch
packets like DHCP requests that have a zero source address in a
legitimate header.  This changes the check to look for a zeroed protocol
number for IP or for both ports be zero for TCP/UDP before considering
the header to not exist.

Reported-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/datapath.c