Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SourceMACField in ICMPv6NDOptSrcLLAddr #4468

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scapy/layers/inet6.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@
UDP,
UDPerror,
)
from scapy.layers.l2 import CookedLinux, Ether, GRE, Loopback, SNAP
from scapy.layers.l2 import (
CookedLinux,
Ether,
GRE,
Loopback,
SNAP,
SourceMACField,
)
from scapy.packet import bind_layers, Packet, Raw
from scapy.sendrecv import sendp, sniff, sr, srp1
from scapy.supersocket import SuperSocket
Expand Down Expand Up @@ -1831,7 +1838,7 @@ class ICMPv6NDOptSrcLLAddr(_ICMPv6NDGuessPayload, Packet):
name = "ICMPv6 Neighbor Discovery Option - Source Link-Layer Address"
fields_desc = [ByteField("type", 1),
ByteField("len", 1),
MACField("lladdr", ETHER_ANY)]
SourceMACField("lladdr")]

def mysummary(self):
return self.sprintf("%name% %lladdr%")
Expand Down
2 changes: 0 additions & 2 deletions scapy/layers/l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ def i2h(self, pkt, x):
# type: (Optional[Packet], Optional[str]) -> str
if x is None:
iff = self.getif(pkt)
if iff is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unrelated to the change, perhaps in a different PR?

iff = conf.iface
if iff:
x = resolve_iface(iff).mac
if x is None:
Expand Down
Loading