Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 3f38e80

Browse files
author
Omid
committed
Fixed a VLAN issue
VLAN was not modifying the ethertype of ethernet layer, if packet already contained a VLAN.
1 parent 3987575 commit 3f38e80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyretic/core/packet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ def encode_in_place(self, pyr, pkt):
385385

386386
if not vlan.vlan in pkt:
387387
pkt.protocols.insert(1, vlan.vlan(ethertype=pkt.protocols[0].ethertype))
388-
pkt.protocols[0].ethertype = VLAN
389388

390389
gen = (protocol for protocol in pkt.protocols if protocol.__class__ == vlan.vlan)
391390
vl = gen.next()
392391
vl.pcp = pyr['vlan_pcp']
392+
pkt.protocols[0].ethertype = VLAN
393393

394394
return pyr
395395

@@ -408,11 +408,11 @@ def encode_in_place(self, pyr, pkt):
408408

409409
if not vlan.vlan in pkt:
410410
pkt.protocols.insert(1, vlan.vlan(ethertype=pkt.protocols[0].ethertype))
411-
pkt.protocols[0].ethertype = VLAN
412411

413412
gen = (protocol for protocol in pkt.protocols if protocol.__class__ == vlan.vlan)
414413
vl = gen.next()
415414
vl.vid = pyr['vlan_id']
415+
pkt.protocols[0].ethertype = VLAN
416416

417417
return pyr
418418

0 commit comments

Comments
 (0)