Skip to content

Commit

Permalink
Fix ttl setting in IGMP.igmpize()
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorzsn authored and gpotter2 committed Mar 23, 2019
1 parent 04e4743 commit 75e1f45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions scapy/contrib/igmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def igmpize(self):
return False
if not any(isinstance(x, IPOption_Router_Alert) for x in underlayer.options): # noqa: E501
underlayer.options.append(IPOption_Router_Alert())
underlayer.ttl = 1 # IP rule 4
_root = self.firstlayer()
if _root.haslayer(Ether):
# Force recalculate Ether dst
Expand Down
4 changes: 4 additions & 0 deletions scapy/contrib/igmp.uts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ x.gaddr = "224.3.2.4"
x[IGMP].igmpize()
assert x.dst == "01:00:5e:03:02:04"

x.ttl = 64
x[IGMP].igmpize()
assert x.ttl == 1

= Test mysummary

x = Ether(src="00:01:02:03:04:05")/IP(src="192.168.0.1")/IGMP(gaddr="224.0.0.2", type=0x17)
Expand Down

0 comments on commit 75e1f45

Please sign in to comment.