diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-05-06 12:18:52 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-05-09 17:10:52 -0700 |
commit | c302dc1427247f5d4c7c76cff1aa62868c352ca7 (patch) | |
tree | 0686a4cf4414fe1c95411c9d9d87a51652de8ba0 | |
parent | 0cc5ebd5b4308988be4c6f38f25dee52afe1cf39 (diff) | |
download | meta-openembedded-c302dc1427247f5d4c7c76cff1aa62868c352ca7.tar.gz |
pcapplusplus: Fix build with gcc14
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 73 insertions, 1 deletions
diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch new file mode 100644 index 000000000..f2e210fc6 --- /dev/null +++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 298dec6f87061914c85049faca3d0ff3310d1794 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 6 May 2024 12:15:30 -0700 | ||
4 | Subject: [PATCH] initialize timespec variable | ||
5 | |||
6 | Fixes build warnings with GCC14 | ||
7 | |||
8 | /mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/pcapplusplus/23.09/git/Packet++/src/RawPacket.cpp: In constructor 'pcpp::RawPacket::RawPacket(const uint8_t*, int, timeval, bool, pcpp::LinkLayerType)': | ||
9 | /mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/pcapplusplus/23.09/git/Packet++/src/RawPacket.cpp:23:18: error: 'nsec_time.timespec::<anonymous>' is used uninitialized [-Werror=uninitialized] | ||
10 | 23 | timespec nsec_time; | ||
11 | | ^~~~~~~~~ | ||
12 | cc1plus: all warnings being treated as errors | ||
13 | |||
14 | Upstream-Status: Submitted [https://github.com/seladb/PcapPlusPlus/pull/1389] | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | Packet++/src/RawPacket.cpp | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/Packet++/src/RawPacket.cpp b/Packet++/src/RawPacket.cpp | ||
21 | index 8ad52d52..07dbbbe2 100644 | ||
22 | --- a/Packet++/src/RawPacket.cpp | ||
23 | +++ b/Packet++/src/RawPacket.cpp | ||
24 | @@ -20,7 +20,7 @@ void RawPacket::init(bool deleteRawDataAtDestructor) | ||
25 | |||
26 | RawPacket::RawPacket(const uint8_t* pRawData, int rawDataLen, timeval timestamp, bool deleteRawDataAtDestructor, LinkLayerType layerType) | ||
27 | { | ||
28 | - timespec nsec_time; | ||
29 | + timespec nsec_time = {}; | ||
30 | TIMEVAL_TO_TIMESPEC(×tamp, &nsec_time); | ||
31 | init(deleteRawDataAtDestructor); | ||
32 | setRawData(pRawData, rawDataLen, nsec_time, layerType); | ||
33 | -- | ||
34 | 2.45.0 | ||
35 | |||
diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-packet-Initialize-m_ExternalRawData-in-IDnsResource-.patch b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-packet-Initialize-m_ExternalRawData-in-IDnsResource-.patch new file mode 100644 index 000000000..b6389e0e3 --- /dev/null +++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-packet-Initialize-m_ExternalRawData-in-IDnsResource-.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 742f564ee80749e9f1f3363092775545e37c0f87 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 9 May 2024 17:02:09 -0700 | ||
4 | Subject: [PATCH] packet++: Initialize m_ExternalRawData in IDnsResource | ||
5 | constructor | ||
6 | |||
7 | Fixes following warning with GCC-14 | ||
8 | |||
9 | Packet++/src/DnsResource.cpp:29:24: error: '*this.pcpp::IDnsResource::m_ExternalRawData' may be used uninitialized [-Werror=maybe-uninitialized] | ||
10 | 29 | return m_ExternalRawData; | ||
11 | | ^~~~~~~~~~~~~~~~~ | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/seladb/PcapPlusPlus/pull/1391] | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | Packet++/src/DnsResource.cpp | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/Packet++/src/DnsResource.cpp b/Packet++/src/DnsResource.cpp | ||
20 | index fec1bf05..c1f97041 100644 | ||
21 | --- a/Packet++/src/DnsResource.cpp | ||
22 | +++ b/Packet++/src/DnsResource.cpp | ||
23 | @@ -10,7 +10,7 @@ namespace pcpp | ||
24 | { | ||
25 | |||
26 | IDnsResource::IDnsResource(DnsLayer* dnsLayer, size_t offsetInLayer) | ||
27 | - : m_DnsLayer(dnsLayer), m_OffsetInLayer(offsetInLayer), m_NextResource(nullptr) | ||
28 | + : m_DnsLayer(dnsLayer), m_OffsetInLayer(offsetInLayer), m_NextResource(nullptr), m_ExternalRawData(nullptr) | ||
29 | { | ||
30 | char decodedName[4096]; | ||
31 | m_NameLength = decodeName((const char*)getRawData(), decodedName); | ||
32 | -- | ||
33 | 2.45.0 | ||
34 | |||
diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb index 39c6942c8..9db022217 100644 --- a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb +++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb | |||
@@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=911690f51af322440237a253d695d19f" | |||
7 | 7 | ||
8 | DEPENDS = "libpcap" | 8 | DEPENDS = "libpcap" |
9 | 9 | ||
10 | SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master" | 10 | SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master \ |
11 | file://0001-packet-Initialize-m_ExternalRawData-in-IDnsResource-.patch \ | ||
12 | file://0001-initialize-timespec-variable.patch" | ||
13 | |||
11 | SRCREV = "4cf8ed44f9dd145f874dc1dd747dfefcfcab75be" | 14 | SRCREV = "4cf8ed44f9dd145f874dc1dd747dfefcfcab75be" |
12 | 15 | ||
13 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |