bgpd: simplify ebgp-multihop and ttl-security handling
Change to track configured value in ->ttl and ->gtsm_hops;
not the value set to sockopt. Instead, setting of socket's ttl
and minttl options are now merged to one function which calculates
it on demand. This greatly simplifies the code.
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 7da63ea..67c50c4 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -716,7 +716,7 @@
}
/* Register to be notified on peer up */
- if ((peer->ttl == 1 || peer->gtsm_hops == 1) &&
+ if ((peer_ttl(peer) == 1 || peer->gtsm_hops == 1) &&
! CHECK_FLAG (peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK))
connected = 1;