datapath: Better handle vlan packets sent to userspace.
We no longer clone packets that are sent via the userspace action
because placing them in Netlink attributes makes a copy so we
generally don't touch the original. The one exception to this is
accelerated vlan tags, which are currently inserted into the
original packet as long as it isn't cloned. Although the clone
check prevents us from causing problems for past packets it has
issues for future processing:
* It turns accelerated tags into non-accelerated tags. This isn't
inherently a problem but some cards may not properly support
offloads with in-band tags.
* It doesn't update CHECKSUM_COMPLETE if there is one.
* If the operation fails, it will free the packet resulting in a
later use-after-free.
This patch fixes the above issues with a conservative approach.
It's possible to do it more efficiently but it probably doesn't
matter in most cases.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>