From: bmichalo Date: Thu, 21 Jul 2016 15:33:02 +0000 (-0400) Subject: pkt_gen: MoonGen incorrectly inserting VLAN tag X-Git-Tag: colorado.1.0~31^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=b859be62b56f1e4cf1eaa534106311ff6ca60b1d;p=vswitchperf.git pkt_gen: MoonGen incorrectly inserting VLAN tag MoonGen needs to take into account the VLAN tag 'enable' control knob defined within the VSPERF traffic profile and therefore only insert the VLAN tag when its 'True'. JIRA: VSPERF-329 Change-Id: Idbeed2f7e6411f0c28aa56a2d3e71bd7a79d975a Signed-off-by: bmichalo --- diff --git a/tools/pkt_gen/moongen/moongen.py b/tools/pkt_gen/moongen/moongen.py index 7af83f26..21dec9cc 100644 --- a/tools/pkt_gen/moongen/moongen.py +++ b/tools/pkt_gen/moongen/moongen.py @@ -138,8 +138,9 @@ class Moongen(ITrafficGenerator): out_file.write("dstIp = \"" + \ str(traffic['l3']['dstip']) + "\",\n") - out_file.write("vlanId = " + \ - str(traffic['vlan']['id']) + ",\n") + if traffic['vlan']['enabled']: + out_file.write("vlanId = " + \ + str(traffic['vlan']['id']) + ",\n") out_file.write("searchRunTime = " + \ str(duration) + ",\n")