git.samba.org
/
asn
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b54587
)
ctdb-common: Stop a pcap-related crash on error
author
Martin Schwenke
<martin@meltin.net>
Tue, 9 Aug 2022 03:49:42 +0000
(13:49 +1000)
committer
Amitay Isaacs
<amitay@samba.org>
Tue, 20 Sep 2022 10:43:37 +0000
(10:43 +0000)
errbuf can't be NULL. Might as well use it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/system_socket.c
patch
|
blob
|
history
diff --git
a/ctdb/common/system_socket.c
b/ctdb/common/system_socket.c
index 71c60853ee31fb365501ee31ee858242af93ba28..43910e9b1771fd493ce550e54743c78fda716e68 100644
(file)
--- a/
ctdb/common/system_socket.c
+++ b/
ctdb/common/system_socket.c
@@
-969,11
+969,14
@@
int ctdb_sys_read_tcp_packet(int s, void *private_data,
int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
{
+ char errbuf[PCAP_ERRBUF_SIZE];
pcap_t *pt;
- pt
=pcap_open_live(iface, 100, 0, 0, NULL
);
+ pt
= pcap_open_live(iface, 100, 0, 0, errbuf
);
if (pt == NULL) {
- DBG_ERR("Failed to open capture device %s\n", iface);
+ DBG_ERR("Failed to open pcap capture device %s (%s)\n",
+ iface,
+ errbuf);
return -1;
}
*((pcap_t **)private_data) = pt;