mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge pull request #14796 from donaldsharp/ospf_bsd_double_whammy_no_whammy
lib: Prevent infinite loop in ospf
This commit is contained in:
commit
3a109ef215
|
@ -23,9 +23,12 @@ void setsockopt_so_recvbuf(int sock, int size)
|
|||
{
|
||||
int orig_req = size;
|
||||
|
||||
while (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size))
|
||||
== -1)
|
||||
while (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) ==
|
||||
-1) {
|
||||
if (size == 0)
|
||||
break;
|
||||
size /= 2;
|
||||
}
|
||||
|
||||
if (size != orig_req)
|
||||
flog_err(EC_LIB_SOCKET,
|
||||
|
@ -37,9 +40,12 @@ void setsockopt_so_sendbuf(const int sock, int size)
|
|||
{
|
||||
int orig_req = size;
|
||||
|
||||
while (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size))
|
||||
== -1)
|
||||
while (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)) ==
|
||||
-1) {
|
||||
if (size == 0)
|
||||
break;
|
||||
size /= 2;
|
||||
}
|
||||
|
||||
if (size != orig_req)
|
||||
flog_err(EC_LIB_SOCKET,
|
||||
|
|
Loading…
Reference in a new issue