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

Centos7 compile error #262

Closed
leoapd19 opened this issue Feb 24, 2023 · 8 comments · Fixed by #263
Closed

Centos7 compile error #262

leoapd19 opened this issue Feb 24, 2023 · 8 comments · Fixed by #263
Assignees

Comments

@leoapd19
Copy link

socket_pcap.c:511:81: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:101: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);

@lmangani
Copy link
Member

Hello @leoapd19 please provide full context to your build execution

@leoapd19
Copy link
Author

hi @lmangani

[root@localhost captagent]# make
Making all in src
make[1]: Entering directory /home/homer/captagent/src' make all-recursive make[2]: Entering directory /home/homer/captagent/src'
Making all in .
make[3]: Entering directory /home/homer/captagent/src' make[3]: Leaving directory /home/homer/captagent/src'
Making all in modules/socket/pcap
make[3]: Entering directory /home/homer/captagent/src/modules/socket/pcap' Making all in . make[4]: Entering directory /home/homer/captagent/src/modules/socket/pcap'
CC socket_pcap_la-socket_pcap.lo
socket_pcap.c: In function 'callback_proto':
socket_pcap.c:470:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (ntohs((uint16_t)(&ethaddr)) == VLAN) {
^
socket_pcap.c:471:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (ntohs((uint16_t)
(&mplsaddr)) == MPLS_UNI) {
^
socket_pcap.c:511:81: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:101: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:121: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:141: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:161: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:511:181: error: dereferencing pointer to incomplete type
snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", sll2->sll2_addr[0], sll2->sll2_addr[1], sll2->sll2_addr[2], sll2->sll2_addr[3], sll2->sll2_addr[4], sll2->sll2_addr[5]);
^
socket_pcap.c:514:33: error: dereferencing pointer to incomplete type
type_ip = ntohs(sll2->sll2_protocol);
^
socket_pcap.c:312:26: warning: unused variable 'ip6_pkt' [-Wunused-variable]
struct ip6_hdr* ip6_pkt = NULL;
^
socket_pcap.c: In function 'websocket_pre_decode':
socket_pcap.c:1029:13: warning: pointer targets in passing argument 2 of 'websocket_decode' differ in signedness [-Wpointer-sign]
websocket_decode((char*)decoded, p_websock, skip, mask_key);
^
socket_pcap.c:275:13: note: expected 'const char *' but argument is of type 'uint8_t *'
static void websocket_decode(char *dst, const char src, size_t len, const char mask[4])
^
socket_pcap.c:1029:13: warning: pointer targets in passing argument 4 of 'websocket_decode' differ in signedness [-Wpointer-sign]
websocket_decode((char
)decoded, p_websock, skip, mask_key);
^
socket_pcap.c:275:13: note: expected 'const char *' but argument is of type 'uint8_t *'
static void websocket_decode(char *dst, const char src, size_t len, const char mask[4])
^
socket_pcap.c:1040:13: warning: pointer targets in passing argument 2 of 'websocket_decode' differ in signedness [-Wpointer-sign]
websocket_decode((char
)decoded, p_websock, skip, mask_key);
^
socket_pcap.c:275:13: note: expected 'const char *' but argument is of type 'uint8_t *'
static void websocket_decode(char *dst, const char src, size_t len, const char mask[4])
^
socket_pcap.c:1040:13: warning: pointer targets in passing argument 4 of 'websocket_decode' differ in signedness [-Wpointer-sign]
websocket_decode((char
)decoded, p_websock, skip, mask_key);
^
socket_pcap.c:275:13: note: expected 'const char *' but argument is of type 'uint8_t *'
static void websocket_decode(char *dst, const char src, size_t len, const char mask[4])
^
socket_pcap.c: In function 'load_module':
socket_pcap.c:1621:9: warning: passing argument 3 of 'pthread_create' from incompatible pointer type [enabled by default]
pthread_create(&stat_thread, NULL, stat_collect, i);
^
In file included from socket_pcap.c:42:0:
/usr/include/pthread.h:235:12: note: expected 'void * (
)(void )' but argument is of type 'void ()(void *)'
extern int pthread_create (pthread_t *__restrict __newthread,
^
socket_pcap.c:1621:9: warning: passing argument 4 of 'pthread_create' makes pointer from integer without a cast [enabled by default]
pthread_create(&stat_thread, NULL, stat_collect, i);
^
In file included from socket_pcap.c:42:0:
/usr/include/pthread.h:235:12: note: expected 'void * restrict' but argument is of type 'unsigned int'
extern int pthread_create (pthread_t *__restrict __newthread,
^
socket_pcap.c: At top level:
socket_pcap.c:193:12: warning: 'check_port_filter' defined but not used [-Wunused-function]
static int check_port_filter(char *filter, int port_arg1, int port_arg2) {
^
socket_pcap.c:258:12: warning: 'strip_fcs_end' defined but not used [-Wunused-function]
static int strip_fcs_end(unsigned char *data, int len) {
^
make[4]: *** [socket_pcap_la-socket_pcap.lo] Error 1
make[4]: Leaving directory /home/homer/captagent/src/modules/socket/pcap' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory /home/homer/captagent/src/modules/socket/pcap'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /home/homer/captagent/src' make[1]: *** [all] Error 2 make[1]: Leaving directory /home/homer/captagent/src'
make: *** [all-recursive] Error 1
[root@localhost captagent]#

@kYroL01 kYroL01 self-assigned this Feb 24, 2023
@kYroL01
Copy link
Collaborator

kYroL01 commented Feb 24, 2023

Hi @leoapd19 seems different OS has different libpcap version.
Could you please tell me your libpcap version ?
Thank you, I will investigate

@btriller
Copy link
Contributor

Probably < 1.10 [1]

[1] https://centos.pkgs.org/7/centos-x86_64/libpcap-devel-1.5.3-12.el7.x86_64.rpm.html

@kYroL01
Copy link
Collaborator

kYroL01 commented Feb 24, 2023

Please @leoapd19 retest again after the fix we merged.
Let me know.
Thanks

@kYroL01 kYroL01 reopened this Feb 24, 2023
@leoapd19
Copy link
Author

Thanks , @kYroL01 its working now .

1 similar comment
@leoapd19
Copy link
Author

Thanks , @kYroL01 its working now .

@kYroL01
Copy link
Collaborator

kYroL01 commented Feb 24, 2023

Thank you as well @btriller for reporting it.
Don't forget to star this project if you like it :)

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

Successfully merging a pull request may close this issue.

4 participants