Comment 11 for bug 1543534

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/17170
Committed: http://github.org/Juniper/contrail-vrouter/commit/d697e011842f8bb544a9c7ab3b15bdfa6fbad34c
Submitter: Zuul
Branch: R2.22.x

commit d697e011842f8bb544a9c7ab3b15bdfa6fbad34c
Author: Anand H. Krishnan <email address hidden>
Date: Fri Feb 12 12:24:59 2016 +0530

Disallow a new sub-interface for an existing vlan
Do not do a 'preset' on mirror packets

When sub-interfaces with the same vlan id are added again with a
different vif index, we overwrite the existing entry in the vlan
table with the new vif. On deletion of the old vif, we check whether
the pointer in the vlan table match or not. If it does not match,
we do not remove the napi setup, but go ahead and free the napi
structure. This could potentially result in memory corruption.

To avoid such scenarios, return an error if a vif already exists
for a particular vlan

When a packet comes from vhost, we typically accept the layer 2
header that is supplied by the host and hence a 'preset' is done
to reset the packet to what it was before it entered vRouter.
Unfortunately, this was also done for packets those mirrored such
packets, leading to offset issues since we do end up adding a lot
more headers than what the original packets contain. This leads to
wrong length calculation and hence searching for more skbs than
that is originally present and a crash.

Change-Id: Ifbff5d2f5aaded7f626f82aea963973bd04f6251
Closes-BUG: #1543534, #1544832