net/scapy: Update version 2.4.3=>2.4.4

Relnotes:	https://github.com/secdev/scapy/releases
This commit is contained in:
Muhammad Moinur Rahman 2020-09-30 01:25:28 +00:00
parent 6658fc3fe1
commit 305b547600
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=550635
3 changed files with 6 additions and 56 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= scapy
PORTVERSION= 2.4.3
PORTREVISION= 3
PORTVERSION= 2.4.4
CATEGORIES= net python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -15,7 +14,8 @@ LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}libdnet>0:net/py-libdnet@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pypcap>0:net/py-pypcap@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}pypcap>0:net/py-pypcap@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cryptography>0:security/py-cryptography@${PY_FLAVOR}
USE_PYTHON= autoplist concurrent distutils

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1568196750
SHA256 (scapy-2.4.3.tar.gz) = e2f8d11f6a941c14a789ae8b236b27bd634681f1b29b5e893861e284d234f6b0
SIZE (scapy-2.4.3.tar.gz) = 905334
TIMESTAMP = 1599950267
SHA256 (scapy-2.4.4.tar.gz) = ecfd7a14cd9c3ef0eb08d28d5bb71d97219edff1454ccbdff229f676b27900ee
SIZE (scapy-2.4.4.tar.gz) = 1039342

View file

@ -1,50 +0,0 @@
--- scapy/arch/bpf/supersocket.py.orig 2019-07-29 18:49:37 UTC
+++ scapy/arch/bpf/supersocket.py
@@ -4,9 +4,11 @@
Scapy *BSD native support - BPF sockets
"""
+from ctypes import c_long, sizeof
import errno
import fcntl
import os
+import platform
from select import select
import struct
import time
@@ -23,7 +25,10 @@ from scapy.supersocket import SuperSocket
from scapy.compat import raw
-if FREEBSD or NETBSD:
+if FREEBSD:
+ # On 32bit architectures long might be 32bit.
+ BPF_ALIGNMENT = sizeof(c_long)
+elif NETBSD:
BPF_ALIGNMENT = 8 # sizeof(long)
else:
BPF_ALIGNMENT = 4 # sizeof(int32_t)
@@ -260,8 +265,21 @@ class L2bpfListenSocket(_L2bpfSocket):
return
# Extract useful information from the BPF header
- if FREEBSD or NETBSD:
- # struct bpf_xhdr or struct bpf_hdr32
+ if FREEBSD:
+ # Unless we set BIOCSTSTAMP to something different than BPF_T_MICROTIME
+ # we will get bpf_hdr on FreeBSD, which means that we'll get a
+ # struct timeval, which is time_t, suseconds_t.
+ # On i386 time_t still is 32bit so the bh_tstamp will only be 8 bytes.
+ # We really want to set BIOCSTSTAMP to BPF_T_NANOTIME and be done with this
+ # and it always be 16?
+ if platform.machine() == "i386":
+ # struct bpf_hdr
+ bh_tstamp_offset = 8
+ else:
+ # struct bpf_hdr (64bit time_t) or struct bpf_xhdr
+ bh_tstamp_offset = 16
+ elif NETBSD:
+ # struct bpf_hdr or struct bpf_hdr32
bh_tstamp_offset = 16
else:
# struct bpf_hdr