from scapy.layers.l2 import Ether, getmacbyip, ARP
from scapy.layers.inet import IP, UDP, ICMP
-from scapy.layers.inet6 import IPv6, in6_getnsmac, in6_mactoifaceid
+from scapy.layers.inet6 import IPv6, in6_getnsmac
+from scapy.utils6 import in6_mactoifaceid
from scapy.layers.dhcp import DHCP, BOOTP, DHCPTypes
from scapy.layers.dhcp6 import DHCP6, DHCP6_Solicit, DHCP6_RelayForward, \
DHCP6_RelayReply, DHCP6_Advertise, DHCP6OptRelayMsg, DHCP6OptIfaceId, \
p_offer = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
IP(src=self.pg3.remote_ip4, dst="255.255.255.255") /
UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
- BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+ BOOTP(op=1,
+ yiaddr=self.pg3.local_ip4,
+ chaddr=mactobinary(self.pg3.local_mac)) /
DHCP(options=[('message-type', 'offer'),
('server_id', self.pg3.remote_ip4),
('end')]))
p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
IP(src=self.pg3.remote_ip4, dst="255.255.255.255") /
UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
- BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+ BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+ chaddr=mactobinary(self.pg3.local_mac)) /
DHCP(options=[('message-type', 'ack'),
('subnet_mask', "255.255.255.0"),
('router', self.pg3.remote_ip4),
p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
- BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+ BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+ chaddr=mactobinary(self.pg3.local_mac)) /
DHCP(options=[('message-type', 'ack'),
('subnet_mask', "255.255.255.0"),
('router', self.pg3.remote_ip4),
p_offer = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
- BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+ BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+ chaddr=mactobinary(self.pg3.local_mac)) /
DHCP(options=[('message-type', 'offer'),
('server_id', self.pg3.remote_ip4),
('end')]))
p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
- BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+ BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+ chaddr=mactobinary(self.pg3.local_mac)) /
DHCP(options=[('message-type', 'ack'),
('subnet_mask', "255.255.255.0"),
('router', self.pg3.remote_ip4),