diff mbox series

[meta-networking,4/4] daq: fix incompatible pointer type error

Message ID 20240606162307.972946-4-kai.kang@windriver.com
State New
Headers show
Series [meta-oe,1/4] xscreensaver: drop removal for CONFIGUREOPTS | expand

Commit Message

Kai June 6, 2024, 4:23 p.m. UTC
From: Kai Kang <kai.kang@windriver.com>

Fix incompatible pointer type error for daq:

| ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
| ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
|   394 |     int len = nfq_get_payload(nfad, (char**)pkt);
|       |                                     ^~~~~~~~~~~
|       |                                     |
|       |                                     char **

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../recipes-connectivity/daq/daq_2.0.7.bb     |  1 +
 ...-fix-incompatible-pointer-type-error.patch | 30 +++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch

Comments

Khem Raj June 6, 2024, 4:32 p.m. UTC | #1
On Thu, Jun 6, 2024 at 9:23 AM Kai Kang via lists.openembedded.org
<kai.kang=windriver.com@lists.openembedded.org> wrote:
>
> From: Kai Kang <kai.kang@windriver.com>
>
> Fix incompatible pointer type error for daq:
>
> | ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
> | ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
> |   394 |     int len = nfq_get_payload(nfad, (char**)pkt);
> |       |                                     ^~~~~~~~~~~
> |       |                                     |
> |       |                                     char **
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  .../recipes-connectivity/daq/daq_2.0.7.bb     |  1 +
>  ...-fix-incompatible-pointer-type-error.patch | 30 +++++++++++++++++++
>  2 files changed, 31 insertions(+)
>  create mode 100644 meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
>
> diff --git a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
> index 66ad83f71..8cb4c04fa 100644
> --- a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
> +++ b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
> @@ -11,6 +11,7 @@ DEPENDS = "libpcap libpcre libdnet bison-native libnetfilter-queue"
>  SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
>             file://disable-run-test-program-while-cross-compiling.patch \
>             file://0001-correct-the-location-of-unistd.h.patch \
> +           file://daq-fix-incompatible-pointer-type-error.patch \
>             "
>  SRC_URI[sha256sum] = "bdc4e5a24d1ea492c39ee213a63c55466a2e8114b6a9abed609927ae13a7705e"
>  # these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
> diff --git a/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
> new file mode 100644
> index 000000000..5a02d1615
> --- /dev/null
> +++ b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
> @@ -0,0 +1,30 @@
> +Fix daq incompatible pointer type error:
> +
> +| ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
> +| ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
> +|   394 |     int len = nfq_get_payload(nfad, (char**)pkt);
> +|       |                                     ^~~~~~~~~~~
> +|       |                                     |
> +|       |                                     char **
> +
> +Upstream-Status: Pending
> +

please submit upstream as well

> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +
> +---
> + os-daq-modules/daq_nfq.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
> +index 4de94b6..a6de2f3 100644
> +--- a/os-daq-modules/daq_nfq.c
> ++++ b/os-daq-modules/daq_nfq.c
> +@@ -391,7 +391,7 @@ static inline int SetPktHdr (
> +     DAQ_PktHdr_t* hdr,
> +     uint8_t** pkt
> + ) {
> +-    int len = nfq_get_payload(nfad, (char**)pkt);
> ++    int len = nfq_get_payload(nfad, (unsigned char**)pkt);
> +
> +     if ( len <= 0 )
> +         return -1;
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#110752): https://lists.openembedded.org/g/openembedded-devel/message/110752
> Mute This Topic: https://lists.openembedded.org/mt/106526692/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Kai June 7, 2024, 8:27 a.m. UTC | #2
On 6/7/24 00:32, Khem Raj wrote:
> On Thu, Jun 6, 2024 at 9:23 AM Kai Kang via lists.openembedded.org
> <kai.kang=windriver.com@lists.openembedded.org> wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> Fix incompatible pointer type error for daq:
>>
>> | ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
>> | ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
>> |   394 |     int len = nfq_get_payload(nfad, (char**)pkt);
>> |       |                                     ^~~~~~~~~~~
>> |       |                                     |
>> |       |                                     char **
>>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>   .../recipes-connectivity/daq/daq_2.0.7.bb     |  1 +
>>   ...-fix-incompatible-pointer-type-error.patch | 30 +++++++++++++++++++
>>   2 files changed, 31 insertions(+)
>>   create mode 100644 meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
>>
>> diff --git a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
>> index 66ad83f71..8cb4c04fa 100644
>> --- a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
>> +++ b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
>> @@ -11,6 +11,7 @@ DEPENDS = "libpcap libpcre libdnet bison-native libnetfilter-queue"
>>   SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
>>              file://disable-run-test-program-while-cross-compiling.patch \
>>              file://0001-correct-the-location-of-unistd.h.patch \
>> +           file://daq-fix-incompatible-pointer-type-error.patch \
>>              "
>>   SRC_URI[sha256sum] = "bdc4e5a24d1ea492c39ee213a63c55466a2e8114b6a9abed609927ae13a7705e"
>>   # these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
>> diff --git a/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
>> new file mode 100644
>> index 000000000..5a02d1615
>> --- /dev/null
>> +++ b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
>> @@ -0,0 +1,30 @@
>> +Fix daq incompatible pointer type error:
>> +
>> +| ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
>> +| ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
>> +|   394 |     int len = nfq_get_payload(nfad, (char**)pkt);
>> +|       |                                     ^~~~~~~~~~~
>> +|       |                                     |
>> +|       |                                     char **
>> +
>> +Upstream-Status: Pending
>> +
> please submit upstream as well
It seems daq belongs to snort2 which I don't find any git repo for it.
There are git repos of snort3 on github but none for snort2.

Regards,
Kai

>
>> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> +
>> +---
>> + os-daq-modules/daq_nfq.c | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
>> +index 4de94b6..a6de2f3 100644
>> +--- a/os-daq-modules/daq_nfq.c
>> ++++ b/os-daq-modules/daq_nfq.c
>> +@@ -391,7 +391,7 @@ static inline int SetPktHdr (
>> +     DAQ_PktHdr_t* hdr,
>> +     uint8_t** pkt
>> + ) {
>> +-    int len = nfq_get_payload(nfad, (char**)pkt);
>> ++    int len = nfq_get_payload(nfad, (unsigned char**)pkt);
>> +
>> +     if ( len <= 0 )
>> +         return -1;
>> --
>> 2.34.1
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#110752): https://lists.openembedded.org/g/openembedded-devel/message/110752
>> Mute This Topic: https://lists.openembedded.org/mt/106526692/1997914
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
index 66ad83f71..8cb4c04fa 100644
--- a/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
+++ b/meta-networking/recipes-connectivity/daq/daq_2.0.7.bb
@@ -11,6 +11,7 @@  DEPENDS = "libpcap libpcre libdnet bison-native libnetfilter-queue"
 SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
            file://disable-run-test-program-while-cross-compiling.patch \
            file://0001-correct-the-location-of-unistd.h.patch \
+           file://daq-fix-incompatible-pointer-type-error.patch \
            "
 SRC_URI[sha256sum] = "bdc4e5a24d1ea492c39ee213a63c55466a2e8114b6a9abed609927ae13a7705e"
 # these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
diff --git a/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
new file mode 100644
index 000000000..5a02d1615
--- /dev/null
+++ b/meta-networking/recipes-connectivity/daq/files/daq-fix-incompatible-pointer-type-error.patch
@@ -0,0 +1,30 @@ 
+Fix daq incompatible pointer type error:
+
+| ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':                                                                                                                                                                          
+| ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2 of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
+|   394 |     int len = nfq_get_payload(nfad, (char**)pkt); 
+|       |                                     ^~~~~~~~~~~
+|       |                                     |                                                                                                                                                                                               
+|       |                                     char **
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ os-daq-modules/daq_nfq.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
+index 4de94b6..a6de2f3 100644
+--- a/os-daq-modules/daq_nfq.c
++++ b/os-daq-modules/daq_nfq.c
+@@ -391,7 +391,7 @@ static inline int SetPktHdr (
+     DAQ_PktHdr_t* hdr,
+     uint8_t** pkt
+ ) {
+-    int len = nfq_get_payload(nfad, (char**)pkt);
++    int len = nfq_get_payload(nfad, (unsigned char**)pkt);
+ 
+     if ( len <= 0 )
+         return -1;