summaryrefslogtreecommitdiffstats
path: root/lib/sockopt.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-18 17:19:46 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-18 17:19:46 -0800
commit3111ae93268b1af36e469b1f7744e821f27f0a30 (patch)
tree0c6282fe70d9f0df38ec5136a046ce14311c0d42 /lib/sockopt.c
parent0b49f5d475aa5503e60d8dbdc9b4dcc8f6a614ec (diff)
parent177fec0b82d18dc92fe40b51bf1a4a294fb9a7ff (diff)
downloadquagga-3111ae93268b1af36e469b1f7744e821f27f0a30.tar.bz2
quagga-3111ae93268b1af36e469b1f7744e821f27f0a30.tar.xz
Merge branch 'jenner' of suva.vyatta.com:/git/vyatta-quagga into jenner
Diffstat (limited to 'lib/sockopt.c')
-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;