Skip to content

Commit

Permalink
lib: define constant for plataforms missing it
Browse files Browse the repository at this point in the history
Add definition of `TCP_MD5SIG_MAXKEYLEN` in the `sockopt.h` header so
users of it have the definition of the maximum key length for socket
authentication operations.

The following OSes reported failure in CI while building:
 - NetBSD 8
 - FreeBSD 11
 - FreeBSD 12

Signed-off-by: Rafael Zalamena <[email protected]>
  • Loading branch information
rzalamena committed Jul 17, 2024
1 parent 25b9842 commit bca54db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/sockopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ extern int setsockopt_ipv6_tclass(int, int);
(((af) == AF_INET) : SOPT_SIZE_CMSG_IFINDEX_IPV4() \
? SOPT_SIZE_CMSG_PKTINFO_IPV6())

/*
* If not defined then define the value for `TCP_MD5SIG_MAXKEYLEN`. This seems
* to be unavailable for NetBSD 8, FreeBSD 11 and FreeBSD 12.
*
* The value below was copied from `linux/tcp.h` from the Linux kernel headers.
*/
#ifndef TCP_MD5SIG_MAXKEYLEN
#define TCP_MD5SIG_MAXKEYLEN 80
#endif

extern int setsockopt_ipv4_multicast_if(int sock, struct in_addr if_addr,
ifindex_t ifindex);
extern int setsockopt_ipv4_multicast(int sock, int optname,
Expand Down
1 change: 1 addition & 0 deletions pimd/pim_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "pimd.h"
#include "pim_nb.h"
#include "lib/northbound_cli.h"
#include "lib/sockopt.h"
#include "pim_igmpv3.h"
#include "pim_neighbor.h"
#include "pim_nht.h"
Expand Down

0 comments on commit bca54db

Please sign in to comment.