mirror of
https://github.com/neocturne/fastd.git
synced 2025-05-14 12:25:07 +02:00
Retry send without pktinfo on ENETUNREACH as well
It seems that newer kernels fail with ENETUNREACH instead of EINVAL with an invalid source address in pktinfo. This fixes fast reconnect on source address change.
This commit is contained in:
parent
c29b4b0e3c
commit
8dc1ed3a1e
1 changed files with 11 additions and 7 deletions
|
@ -133,8 +133,11 @@ static void send_type(const fastd_socket_t *sock, const fastd_peer_address_t *lo
|
|||
|
||||
int ret = sendmsg(sock->fd.fd, &msg, 0);
|
||||
|
||||
if (ret < 0 && errno == EINVAL && msg.msg_controllen) {
|
||||
pr_debug2("sendmsg failed, trying again without pktinfo");
|
||||
if (ret < 0 && msg.msg_controllen) {
|
||||
switch (errno) {
|
||||
case EINVAL:
|
||||
case ENETUNREACH:
|
||||
pr_debug2("sendmsg: %s (trying again without pktinfo)", strerror(errno));
|
||||
|
||||
if (peer && !fastd_peer_handshake_scheduled(peer))
|
||||
fastd_peer_schedule_handshake_default(peer);
|
||||
|
@ -144,6 +147,7 @@ static void send_type(const fastd_socket_t *sock, const fastd_peer_address_t *lo
|
|||
|
||||
ret = sendmsg(sock->fd.fd, &msg, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
switch (errno) {
|
||||
|
|
Loading…
Add table
Reference in a new issue