The implementation of the TAP net backend already supports the case (s->host_vnet_hdr_len && !s->using_vnet_hdr), which means that the TAP device is expecting the header, while the net frontend (emulated device) is not aware of it. This case is handled by stripping or prepending the (zeroed) header on the fly. However, the function tap_using_vnet_hdr() has an assert() that explicitly prevents this situation to happen. This patch removes the assert(), so that net frontends are free to un-negotiate the header.
Signed-off-by: Vincenzo Maffione <v.maffi...@gmail.com> --- net/tap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/tap.c b/net/tap.c index cc8525f154..6f2aca0396 100644 --- a/net/tap.c +++ b/net/tap.c @@ -264,7 +264,6 @@ static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr) TAPState *s = DO_UPCAST(TAPState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_TAP); - assert(!!s->host_vnet_hdr_len == using_vnet_hdr); s->using_vnet_hdr = using_vnet_hdr; } -- 2.20.1