diff options
Diffstat (limited to 'bfdd/ptm_adapter.c')
| -rw-r--r-- | bfdd/ptm_adapter.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 1a23a690e0..48e55bce37 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -152,8 +152,7 @@ static void _ptm_bfd_session_del(struct bfd_session *bs, uint8_t diag) */ if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG)) { zlog_err( - "ptm-del-session: [%s] session refcount is " - "zero but it was configured by CLI", + "ptm-del-session: [%s] session refcount is zero but it was configured by CLI", bs_to_string(bs)); } else { control_notify_config(BCM_NOTIFY_CONFIG_DELETE, bs); @@ -304,7 +303,6 @@ static int _ptm_msg_read(struct stream *msg, int command, vrf_id_t vrf_id, struct bfd_peer_cfg *bpc, struct ptm_client **pc) { uint32_t pid; - uint8_t ttl __attribute__((unused)); size_t ifnamelen; /* @@ -376,7 +374,18 @@ static int _ptm_msg_read(struct stream *msg, int command, vrf_id_t vrf_id, if (bpc->bpc_mhop) { /* Read multihop source address and TTL. */ _ptm_msg_read_address(msg, &bpc->bpc_local); - STREAM_GETC(msg, ttl); + STREAM_GETC(msg, bpc->bpc_minimum_ttl); + if (bpc->bpc_minimum_ttl >= BFD_TTL_VAL + || bpc->bpc_minimum_ttl == 0) { + zlog_warn("%s: received invalid TTL configuration %d", + __func__, bpc->bpc_has_minimum_ttl); + bpc->bpc_minimum_ttl = BFD_DEF_MHOP_TTL; + bpc->bpc_has_minimum_ttl = false; + } else { + bpc->bpc_minimum_ttl = + (BFD_TTL_VAL + 1) - bpc->bpc_minimum_ttl; + bpc->bpc_has_minimum_ttl = true; + } } else { /* If target is IPv6, then we must obtain local address. */ if (bpc->bpc_ipv4 == false) |
