Neale Ranns | ad422ed | 2016-11-02 14:20:04 +0000 | [diff] [blame] | 1 | diff --git a/scapy/contrib/mpls.py b/scapy/contrib/mpls.py |
| 2 | index 640a0c5..6af1d4a 100644 |
| 3 | --- a/scapy/contrib/mpls.py |
| 4 | +++ b/scapy/contrib/mpls.py |
| 5 | @@ -18,6 +18,8 @@ class MPLS(Packet): |
| 6 | |
| 7 | def guess_payload_class(self, payload): |
| 8 | if len(payload) >= 1: |
| 9 | + if not self.s: |
| 10 | + return MPLS |
| 11 | ip_version = (ord(payload[0]) >> 4) & 0xF |
| 12 | if ip_version == 4: |
| 13 | return IP |
Neale Ranns | 71275e3 | 2017-05-25 12:38:58 -0700 | [diff] [blame] | 14 | @@ -27,3 +29,4 @@ class MPLS(Packet): |
| 15 | |
| 16 | bind_layers(Ether, MPLS, type=0x8847) |
| 17 | bind_layers(GRE, MPLS, proto=0x8847) |
| 18 | +bind_layers(MPLS, MPLS, s=0) |