summaryrefslogtreecommitdiff
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-03-24 10:51:59 +0000
committerPaul Jakma <paul@quagga.net>2011-03-24 10:51:59 +0000
commit89b6d1f8e2759cc38bc768067abe3a296d93f454 (patch)
treeebf4d27f1d93558bba8d0bf6f1022182f7066404 /lib/sockunion.c
parentfa411a212b55bba650d68fd0456686f3e47b7395 (diff)
bgpd: Cleanups & fixes for minttl / GTSM
* bgp_vty.c: (peer_ebgp_multihop_{un,}set_vty) tail-call cleanup. ({no_,}neighbor_ttl_security) ditto. * bgpd.c: (peer_ttl_security_hops_set) Peer group checks and TTL set only need to be done on transition. * sockunion.c: (sockopt_minttl) remove always-on debug and improve readability.
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index a32809c1..df05acb3 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -540,23 +540,23 @@ sockopt_cork (int sock, int onoff)
int
sockopt_minttl (int family, int sock, int minttl)
{
+#ifdef IP_MINTTL
int ret;
- zlog_debug ("sockopt_minttl: set minttl to %d", minttl);
-
-#ifdef IP_MINTTL
ret = setsockopt (sock, IPPROTO_IP, IP_MINTTL, &minttl, sizeof(minttl));
-#else
- ret = -1;
- errno = EOPNOTSUPP;
-#endif /* IP_MINTTL */
if (ret < 0)
{
- zlog (NULL, LOG_WARNING, "can't set sockopt IP_MINTTL to %d on socket %d: %s", minttl, sock, safe_strerror (errno));
+ zlog (NULL, LOG_WARNING,
+ "can't set sockopt IP_MINTTL to %d on socket %d: %s",
+ minttl, sock, safe_strerror (errno));
return -1;
}
return 0;
+#else
+ errno = EOPNOTSUPP;
+ return -1;
+#endif /* IP_MINTTL */
}
/* If same family and same prefix return 1. */