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

Make dhcpcanon work with latest release of scapy (2.6.0) #37

Open
charles2910 opened this issue Oct 5, 2024 · 0 comments
Open

Make dhcpcanon work with latest release of scapy (2.6.0) #37

charles2910 opened this issue Oct 5, 2024 · 0 comments

Comments

@charles2910
Copy link

Hi, I've packaged scapy latest version and realized dhcpcanon failed to build against it. So here are the patches needed to fix it (only the first one is mine).

From bd7d5c0f92e073c7855cac69db8eb2e6c2fe4b0f Mon Sep 17 00:00:00 2001
From: Carlos Henrique Lima Melara <[email protected]>
Date: Sat, 5 Oct 2024 09:53:30 -0300
Subject: [PATCH 4/4] fix FTBFS with scapy 2.6.0

In the latest version of scapy, get_if_raw_hwaddr has been moved to
scapy.arch.unix module.
---
 dhcpcanon/dhcpcap.py    | 2 +-
 dhcpcanon/dhcpcapfsm.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dhcpcanon/dhcpcap.py b/dhcpcanon/dhcpcap.py
index c6da57f..453cfd2 100644
--- a/dhcpcanon/dhcpcap.py
+++ b/dhcpcanon/dhcpcap.py
@@ -10,7 +10,7 @@ import logging

 import attr
 from netaddr import IPNetwork
-from scapy.arch import get_if_raw_hwaddr
+from scapy.arch.unix import get_if_raw_hwaddr
 from scapy.config import conf
 from scapy.layers.dhcp import BOOTP, DHCP
 from scapy.layers.inet import IP, UDP
diff --git a/dhcpcanon/dhcpcapfsm.py b/dhcpcanon/dhcpcapfsm.py
index 1f4bb0b..d4a5669 100644
--- a/dhcpcanon/dhcpcapfsm.py
+++ b/dhcpcanon/dhcpcapfsm.py
@@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals
 import logging

 from netaddr import AddrFormatError
-from scapy.arch import get_if_raw_hwaddr
+from scapy.arch.unix import get_if_raw_hwaddr
 from scapy.automaton import ATMT, Automaton
 from scapy.config import conf
 from scapy.sendrecv import sendp
--
2.45.2

And,

From fbe1ecfafd55e0c22e3513502b997d88b6a62c52 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <[email protected]>
Date: Sat, 5 Oct 2024 09:47:52 -0300
Subject: [PATCH 1/4] follow-scapy-changes

===================================================================

Gbp-Pq: Name follow-scapy-changes
---
 dhcpcanon/dhcpcaputils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dhcpcanon/dhcpcaputils.py b/dhcpcanon/dhcpcaputils.py
index 70210a4..55e8668 100644
--- a/dhcpcanon/dhcpcaputils.py
+++ b/dhcpcanon/dhcpcaputils.py
@@ -8,7 +8,7 @@ from __future__ import absolute_import
 import logging
 import random

-from scapy.arch.linux import get_if_list
+from scapy.interfaces import get_if_list
 from scapy.layers.dhcp import DHCP, DHCPTypes

 from .constants import XID_MIN, XID_MAX
--
2.45.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant