replace scapy with rpm from CentOS 7.5 directly

Story: 2003174
Task: 23318

Depends On: https://review.openstack.org/#/c/589122/

Change-Id: If121c5b940173e81d67375d523c3075ea740789c
Signed-off-by: slin14 <shuicheng.lin@intel.com>
This commit is contained in:
slin14 2018-08-07 03:20:28 +08:00
parent d4acd17fc5
commit e90ab5fee3
7 changed files with 0 additions and 133 deletions

View File

@ -43,7 +43,6 @@ base/net-snmp
ldap/openldap
networking/mellanox/mlx4-config
networking/openvswitch
networking/scapy
restapi-doc
base/libevent
security/wrs-ssl

View File

@ -1 +0,0 @@
TIS_PATCH_VER=1

View File

@ -1,28 +0,0 @@
From eb8036a5e84abe57f407e57f744532693fa49af3 Mon Sep 17 00:00:00 2001
From: Allain Legacy <allain.legacy@windriver.com>
Date: Mon, 26 Feb 2018 08:03:04 -0600
Subject: [PATCH 1/2] spec: update package versioning for tis format
Updating the RPM version to align with TiS version format.
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
SPECS/scapy.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/scapy.spec b/SPECS/scapy.spec
index 9c04bae..add5a84 100644
--- a/SPECS/scapy.spec
+++ b/SPECS/scapy.spec
@@ -5,7 +5,7 @@
Name: scapy
Version: 2.3.3
-Release: 1%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: Interactive packet manipulation tool and network scanner
Group: Applications/Internet
--
2.12.1

View File

@ -1,36 +0,0 @@
From 6d23d7b91388213ff090159f52af3aa88a6684c8 Mon Sep 17 00:00:00 2001
From: Allain Legacy <allain.legacy@windriver.com>
Date: Mon, 26 Feb 2018 08:04:47 -0600
Subject: [PATCH 2/2] spec: include ipv6 fixes from 2.4 release candidate
Pulling in patches from the 2.4 release candidate series in order to address
various IPv6 formatting/parsing issues.
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
SPECS/scapy.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/scapy.spec b/SPECS/scapy.spec
index add5a84..7afe35f 100644
--- a/SPECS/scapy.spec
+++ b/SPECS/scapy.spec
@@ -15,6 +15,7 @@ URL: http://www.secdev.org/projects/scapy/
# https://bitbucket.org/secdev/scapy/pull-request/80
Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: scapy-2.2.0-xdg-open.patch
+Patch1: 0001-Use-socket.pton-socket.ntop-is-available.patch
BuildArch: noarch
BuildRequires: python >= 2.5
@@ -31,6 +32,7 @@ requests and replies, and much more.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
%{__python} setup.py build
--
2.12.1

View File

@ -1,2 +0,0 @@
0001-spec-update-package-versioning-for-tis-format.patch
0002-spec-include-ipv6-fixes-from-2.4-release-candidate.patch

View File

@ -1,64 +0,0 @@
From 333afaf9b1a30acbf5279b04e33d9469d97ee24d Mon Sep 17 00:00:00 2001
From: Guillaume Valadon <guillaume.valadon@ssi.gouv.fr>
Date: Thu, 24 Nov 2016 16:13:05 +0100
Subject: [PATCH] Use socket.pton & socket.ntop is available
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
scapy/pton_ntop.py | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/scapy/pton_ntop.py b/scapy/pton_ntop.py
index ce93b67..8196b01 100644
--- a/scapy/pton_ntop.py
+++ b/scapy/pton_ntop.py
@@ -17,6 +17,12 @@ def inet_pton(af, addr):
if af == socket.AF_INET:
return socket.inet_aton(addr)
elif af == socket.AF_INET6:
+ # Use inet_pton if available
+ try:
+ return socket.inet_pton(af, addr)
+ except AttributeError:
+ pass
+
# IPv6: The use of "::" indicates one or more groups of 16 bits of zeros.
# We deal with this form of wildcard using a special marker.
JOKER = "*"
@@ -65,6 +71,12 @@ def inet_ntop(af, addr):
if af == socket.AF_INET:
return socket.inet_ntoa(addr)
elif af == socket.AF_INET6:
+ # Use inet_ntop if available
+ try:
+ return socket.inet_ntop(af, addr)
+ except AttributeError:
+ pass
+
# IPv6 addresses have 128bits (16 bytes)
if len(addr) != 16:
raise Exception("Illegal syntax for IP address")
@@ -75,15 +87,9 @@ def inet_ntop(af, addr):
hexstr = hex(value)[2:]
except TypeError:
raise Exception("Illegal syntax for IP address")
- parts.append(hexstr.lstrip("0").lower())
- result = ":".join(parts)
- while ":::" in result:
- result = result.replace(":::", "::")
- # Leaving out leading and trailing zeros is only allowed with ::
- if result.endswith(":") and not result.endswith("::"):
- result = result + "0"
- if result.startswith(":") and not result.startswith("::"):
- result = "0" + result
- return result
+ parts.append(hexstr.lower())
+
+ # Note: the returned address is never compact
+ return ":".join(parts)
else:
- raise Exception("Address family not supported yet")
+ raise Exception("Address family not supported yet")
--
2.12.1

View File

@ -1 +0,0 @@
mirror:Source/scapy-2.3.3-1.el7.src.rpm