1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Martin Schwenke 2022-08-08 11:31:03 +10:00 committed by Amitay Isaacs
parent ad445abebd
commit 8b54587b1a

View File

@ -998,7 +998,7 @@ int ctdb_sys_read_tcp_packet(int s,
uint16_t *window) uint16_t *window)
{ {
int ret; int ret;
struct ether_header *eth; const struct ether_header *eth;
struct pcap_pkthdr pkthdr; struct pcap_pkthdr pkthdr;
const u_char *buffer; const u_char *buffer;
pcap_t *pt = (pcap_t *)private_data; pcap_t *pt = (pcap_t *)private_data;
@ -1012,7 +1012,7 @@ int ctdb_sys_read_tcp_packet(int s,
ZERO_STRUCTP(dst); ZERO_STRUCTP(dst);
/* Ethernet */ /* Ethernet */
eth = (struct ether_header *)buffer; eth = (const struct ether_header *)buffer;
/* we want either IPv4 or IPv6 */ /* we want either IPv4 or IPv6 */
if (eth->ether_type == htons(ETHERTYPE_IP)) { if (eth->ether_type == htons(ETHERTYPE_IP)) {