[pgpool-hackers: 4602] heartbeat and SO_BINDTODEVICE
Tatsuo Ishii
ishii at postgresql.org
Sat May 31 19:29:43 JST 2025
wd_create_hb_recv_socket() and wd_create_hb_send_socket() calls
setsockopt(2) like this:
struct ifreq i;
strlcpy(i.ifr_name, hb_if->if_name, sizeof(i.ifr_name));
if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, &i, sizeof(i)) == -1)
:
I think this is not quite correct since the 4th arugument should be
just a null terminated string (device name), not struct ifreq. From
socket(7) man page:
SO_BINDTODEVICE
Bind this socket to a particular device like “eth0”,
as specified in the passed interface name. If the name
is an empty string or the option length is zero, the
socket device binding is removed. The passed option is
a variable- length null-terminated interface name string
with the maximum size of IFNAMSIZ.
Patch attached.
Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wd_hb.patch
Type: application/octet-stream
Size: 1776 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20250531/90998973/attachment.obj>
More information about the pgpool-hackers
mailing list