mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-14 18:35:31 +00:00
[lib] Fix mistake in tcp-md5sig commit which broke compile on BSD
2008-08-15 Paul Jakma <paul.jakma@sun.com> * lib/sockopt.c: (sockopt_tcp_signature) ifdef'ing hid variable declaration for HAVE_DECL_TCP_MD5SIG && !GNU_LINUX, breaking compile - fix.
This commit is contained in:
parent
6ac29a5107
commit
f5612dd382
@ -499,6 +499,7 @@ int
|
|||||||
sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
|
sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
|
||||||
{
|
{
|
||||||
#if HAVE_DECL_TCP_MD5SIG
|
#if HAVE_DECL_TCP_MD5SIG
|
||||||
|
int ret;
|
||||||
#ifndef GNU_LINUX
|
#ifndef GNU_LINUX
|
||||||
/*
|
/*
|
||||||
* XXX Need to do PF_KEY operation here to add/remove an SA entry,
|
* XXX Need to do PF_KEY operation here to add/remove an SA entry,
|
||||||
@ -509,7 +510,6 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
|
|||||||
int keylen = password ? strlen (password) : 0;
|
int keylen = password ? strlen (password) : 0;
|
||||||
struct tcp_md5sig md5sig;
|
struct tcp_md5sig md5sig;
|
||||||
union sockunion *su2, *susock;
|
union sockunion *su2, *susock;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Figure out whether the socket and the sockunion are the same family..
|
/* Figure out whether the socket and the sockunion are the same family..
|
||||||
* adding AF_INET to AF_INET6 needs to be v4 mapped, you'd think..
|
* adding AF_INET to AF_INET6 needs to be v4 mapped, you'd think..
|
||||||
@ -553,9 +553,9 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
|
|||||||
md5sig.tcpm_keylen = keylen;
|
md5sig.tcpm_keylen = keylen;
|
||||||
if (keylen)
|
if (keylen)
|
||||||
memcpy (md5sig.tcpm_key, password, keylen);
|
memcpy (md5sig.tcpm_key, password, keylen);
|
||||||
|
sockunion_free (susock);
|
||||||
#endif /* GNU_LINUX */
|
#endif /* GNU_LINUX */
|
||||||
ret = setsockopt (sock, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof md5sig);
|
ret = setsockopt (sock, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof md5sig);
|
||||||
sockunion_free (susock);
|
|
||||||
return ret;
|
return ret;
|
||||||
#else /* HAVE_TCP_MD5SIG */
|
#else /* HAVE_TCP_MD5SIG */
|
||||||
return -2;
|
return -2;
|
||||||
|
Loading…
Reference in New Issue
Block a user