summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2008-08-15 14:05:08 +0100
committerPaul Jakma <paul@quagga.net>2008-08-22 19:52:58 +0100
commitf5612dd382d9c0f4089b08ec164c25a8082d9f89 (patch)
tree6766dccbdf57cc0b936d622c8172ae7a9f8cfc6e /lib
parent6ac29a51075def99217a4ab1015635db3b3e83ed (diff)
[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.
Diffstat (limited to 'lib')
-rw-r--r--lib/sockopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 2f01199a..4ba7e874 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -499,6 +499,7 @@ int
sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
{
#if HAVE_DECL_TCP_MD5SIG
+ int ret;
#ifndef GNU_LINUX
/*
* 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;
struct tcp_md5sig md5sig;
union sockunion *su2, *susock;
- int ret;
/* 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..
@@ -553,9 +553,9 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
md5sig.tcpm_keylen = keylen;
if (keylen)
memcpy (md5sig.tcpm_key, password, keylen);
+ sockunion_free (susock);
#endif /* GNU_LINUX */
ret = setsockopt (sock, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof md5sig);
- sockunion_free (susock);
return ret;
#else /* HAVE_TCP_MD5SIG */
return -2;