MPLS label layering/stacking clears the EOS bit

Signed-off-by: Neale Ranns <nranns@cisco.com>
This commit is contained in:
Neale Ranns 2017-05-25 12:36:22 -07:00 committed by Guillaume Valadon
parent 94df5760f7
commit cc02b632bb
2 changed files with 18 additions and 0 deletions

View File

@ -41,3 +41,4 @@ class MPLS(Packet):
bind_layers(Ether, MPLS, type=0x8847)
bind_layers(GRE, MPLS, proto=0x8847)
bind_layers(MPLS, MPLS, s=0)

View File

@ -8492,3 +8492,20 @@ class Test(Packet):
pkt = Test(str(Test(Values=[0, 0, 0, 0, 1, 1, 1, 1])))
assert(pkt.BitCount == 8)
assert(pkt.ByteCount == 1)
############
############
+ MPLS tests
= MPLS - build/dissection
from scapy.contrib.mpls import MPLS
p1 = MPLS()/IP()/UDP()
assert(p1[MPLS].s == 1)
p2 = MPLS()/MPLS()/IP()/UDP()
assert(p2[MPLS].s == 0)
p1[MPLS]
p1[IP]
p2[MPLS]
p2[MPLS:1]
p2[IP]