summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ldpd/hello.c')
-rw-r--r--usr.sbin/ldpd/hello.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c
index 8cbdcf7642b..fff514570fd 100644
--- a/usr.sbin/ldpd/hello.c
+++ b/usr.sbin/ldpd/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.21 2013/10/15 20:13:47 renato Exp $ */
+/* $OpenBSD: hello.c,v 1.22 2013/10/15 20:21:24 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -197,19 +197,14 @@ recv_hello(struct iface *iface, struct in_addr src, char *buf, u_int16_t len)
case HELLO_LINK:
if (holdtime == 0)
holdtime = LINK_DFLT_HOLDTIME;
- if (iface->hello_holdtime < holdtime)
- adj->holdtime = iface->hello_holdtime;
- else
- adj->holdtime = holdtime;
+
+ adj->holdtime = min(iface->hello_holdtime, holdtime);
break;
case HELLO_TARGETED:
if (holdtime == 0)
holdtime = TARGETED_DFLT_HOLDTIME;
- if (tnbr->hello_holdtime < holdtime)
- adj->holdtime = tnbr->hello_holdtime;
- else
- adj->holdtime = holdtime;
- break;
+
+ adj->holdtime = min(tnbr->hello_holdtime, holdtime);
}
if (adj->holdtime != INFINITE_HOLDTIME)