datapath: Relax set header validation.
authorJesse Gross <jesse@nicira.com>
Fri, 3 Aug 2012 01:22:38 +0000 (18:22 -0700)
committerJesse Gross <jesse@nicira.com>
Sat, 4 Aug 2012 02:27:05 +0000 (19:27 -0700)
commit6e9bea4da975729edf650c94430a02cc0518e383
tree717bdd8e18843e3b82941d03ffa042461684f0b1
parent1b58552471d1149033cbb6b85d2a5d567f8f8e0e
datapath: 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.

Bug #12769

Reported-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/datapath.c
lib/odp-util.c