ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.
authorBen Pfaff <blp@nicira.com>
Fri, 24 Jul 2015 22:30:58 +0000 (15:30 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 27 Jul 2015 22:13:45 +0000 (15:13 -0700)
commita45475400a44065efb8667f0ef2e3de91ed31ca0
tree94896ddcd3d5c8467f783f6e70f75bcb4432ac19
parent980904823303ef02af605e62a30c9bebda25f1ef
ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.

When a mirror was restricted to particular VLANs, this code was allocating,
copying, and freeing a 512-byte block of memory just to check the value of
a single bit in the block.  This fixes the problem.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
ofproto/ofproto-dpif-mirror.c
ofproto/ofproto-dpif-mirror.h
ofproto/ofproto-dpif-xlate.c