summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2022-08-08 11:31:03 +1000
committerAmitay Isaacs <amitay@samba.org>2022-09-20 10:43:37 +0000
commit8b54587b1aed28aa2f3af7161a077aa9dd83894c (patch)
tree390469e470ebbfbb963c08d17b5bee60c10e49bc /ctdb
parentad445abebdea55f71b0c79eb31c0e6b0aee06763 (diff)
downloadsamba-8b54587b1aed28aa2f3af7161a077aa9dd83894c.tar.gz
ctdb-common: Fix a warning in the pcap code
[173/416] Compiling ctdb/common/system_socket.c ../../common/system_socket.c: In function ‘ctdb_sys_read_tcp_packet’: ../../common/system_socket.c:1016:15: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] 1016 | eth = (struct ether_header *)buffer; | ^ Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/system_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c
index ced2b17fc21..71c60853ee3 100644
--- a/ctdb/common/system_socket.c
+++ b/ctdb/common/system_socket.c
@@ -998,7 +998,7 @@ int ctdb_sys_read_tcp_packet(int s,
uint16_t *window)
{
int ret;
- struct ether_header *eth;
+ const struct ether_header *eth;
struct pcap_pkthdr pkthdr;
const u_char *buffer;
pcap_t *pt = (pcap_t *)private_data;
@@ -1012,7 +1012,7 @@ int ctdb_sys_read_tcp_packet(int s,
ZERO_STRUCTP(dst);
/* Ethernet */
- eth = (struct ether_header *)buffer;
+ eth = (const struct ether_header *)buffer;
/* we want either IPv4 or IPv6 */
if (eth->ether_type == htons(ETHERTYPE_IP)) {