]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: define constant for plataforms missing it
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 10 May 2022 11:23:06 +0000 (08:23 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 29 Jul 2024 14:41:39 +0000 (11:41 -0300)
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 <rzalamena@opensourcerouting.org>
lib/sockopt.h
pimd/pim_nb_config.c

index ce7d665fab5f2686456e418dc0cc65248d04ebd7..e6fb78d5e4efac03e699090ec059be37b257040b 100644 (file)
@@ -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,
index 328463c40ebcc62b3c045ced495e679157281d42..bc7338ce1826c0efd82b8e340444533a2c17e489 100644 (file)
@@ -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"