git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98ee0c1
)
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
Jule Anger
<janger@samba.org>
Tue, 29 Aug 2023 09:35:11 +0000
(09:35 +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>
(cherry picked from commit
40380a8042dfc2efa6f8f06ed7ac86c3c20a343f
)
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;