mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 11:30:30 +00:00
lib: add TCP_CORK wrapper
* sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for those platforms that provide it. For other platforms, it is just a nop.
This commit is contained in:
parent
35398589cf
commit
58192df774
@ -527,6 +527,16 @@ sockopt_ttl (int family, int sock, int ttl)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sockopt_cork (int sock, int onoff)
|
||||
{
|
||||
#ifdef TCP_CORK
|
||||
return setsockopt (sock, IPPROTO_TCP, TCP_CORK, &onoff, sizeof(onoff));
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If same family and same prefix return 1. */
|
||||
int
|
||||
sockunion_same (union sockunion *su1, union sockunion *su2)
|
||||
|
@ -102,6 +102,7 @@ extern int sockopt_reuseport (int);
|
||||
extern int sockunion_bind (int sock, union sockunion *,
|
||||
unsigned short, union sockunion *);
|
||||
extern int sockopt_ttl (int family, int sock, int ttl);
|
||||
extern int sockopt_cork (int sock, int onoff);
|
||||
extern int sockunion_socket (union sockunion *su);
|
||||
extern const char *inet_sutop (union sockunion *su, char *str);
|
||||
extern enum connect_result sockunion_connect (int fd, union sockunion *su,
|
||||
|
Loading…
Reference in New Issue
Block a user