aboutsummaryrefslogtreecommitdiff
path: root/pcap-bt-monitor-linux.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-05-16 15:21:11 +0200
committerfxlb <devel.fx.lebail@orange.fr>2023-05-18 09:51:11 +0000
commitf8e510aaefcb0c229ce72116c3b6902bf2e3da63 (patch)
tree4cd980faa1da2fabdcce38ec80a9ec5f8156232b /pcap-bt-monitor-linux.c
parentc7b90298984c46d820d3cee79a96d24870b5f200 (diff)
struct pcap: Update buffer type from "void *" to "u_char *"
This change should avoid these cppcheck warnings: pcap-hurd.c:77:18: warning: 'p->buffer' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] pkt = p->buffer + offsetof(struct net_rcv_msg, packet) ^ pcap-hurd.c:78:8: warning: 'p->buffer+offsetof(struct net_rcv_msg,packet)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] + sizeof(struct packet_header) - ETH_HLEN; ^ pcap-hurd.c:79:25: warning: 'p->buffer' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] memmove(pkt, p->buffer + offsetof(struct net_rcv_msg, header), ^ Remove some '(u_char *)' casts accordingly.
Diffstat (limited to 'pcap-bt-monitor-linux.c')
-rw-r--r--pcap-bt-monitor-linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pcap-bt-monitor-linux.c b/pcap-bt-monitor-linux.c
index 206e65b5..3d4f0b08 100644
--- a/pcap-bt-monitor-linux.c
+++ b/pcap-bt-monitor-linux.c
@@ -102,7 +102,7 @@ bt_monitor_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_ch
u_char *pktd;
struct hci_mon_hdr hdr;
- pktd = (u_char *)handle->buffer + BT_CONTROL_SIZE;
+ pktd = handle->buffer + BT_CONTROL_SIZE;
bthdr = (pcap_bluetooth_linux_monitor_header*)(void *)pktd;
iv[0].iov_base = &hdr;