diff options
Diffstat (limited to 'eigrpd/eigrp_hello.c')
| -rw-r--r-- | eigrpd/eigrp_hello.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c index dacd5caeb5..6f93cd7b3e 100644 --- a/eigrpd/eigrp_hello.c +++ b/eigrpd/eigrp_hello.c @@ -147,7 +147,7 @@ eigrp_hello_parameter_decode(struct eigrp_neighbor *nbr, zlog_info("Neighbor %s (%s) is pending: new adjacency", inet_ntoa(nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, - VRF_DEFAULT)); + eigrp->vrf_id)); /* Expedited hello sent */ eigrp_hello_send(nbr->ei, EIGRP_HELLO_NORMAL, NULL); @@ -167,7 +167,7 @@ eigrp_hello_parameter_decode(struct eigrp_neighbor *nbr, "Neighbor %s (%s) is down: Interface PEER-TERMINATION received", inet_ntoa(nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, - VRF_DEFAULT)); + eigrp->vrf_id)); eigrp_nbr_delete(nbr); return NULL; } else { @@ -175,7 +175,7 @@ eigrp_hello_parameter_decode(struct eigrp_neighbor *nbr, "Neighbor %s (%s) going down: Kvalue mismatch", inet_ntoa(nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, - VRF_DEFAULT)); + eigrp->vrf_id)); eigrp_nbr_state_set(nbr, EIGRP_NEIGHBOR_DOWN); } } @@ -245,6 +245,7 @@ static void eigrp_sw_version_decode(struct eigrp_neighbor *nbr, static void eigrp_peer_termination_decode(struct eigrp_neighbor *nbr, struct eigrp_tlv_hdr_type *tlv) { + struct eigrp *eigrp = nbr->ei->eigrp; struct TLV_Peer_Termination_type *param = (struct TLV_Peer_Termination_type *)tlv; @@ -254,7 +255,7 @@ static void eigrp_peer_termination_decode(struct eigrp_neighbor *nbr, if (my_ip == received_ip) { zlog_info("Neighbor %s (%s) is down: Peer Termination received", inet_ntoa(nbr->src), - ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); + ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id)); /* set neighbor to DOWN */ nbr->state = EIGRP_NEIGHBOR_DOWN; /* delete neighbor */ @@ -330,7 +331,7 @@ void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph, if (IS_DEBUG_EIGRP_PACKET(eigrph->opcode - 1, RECV)) zlog_debug("Processing Hello size[%u] int(%s) nbr(%s)", size, - ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT), + ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id), inet_ntoa(nbr->src)); size -= EIGRP_HEADER_LEN; @@ -484,21 +485,15 @@ static uint16_t eigrp_tidlist_encode(struct stream *s) * Part of conditional receive process * */ -static uint16_t eigrp_sequence_encode(struct stream *s) +static uint16_t eigrp_sequence_encode(struct eigrp *eigrp, struct stream *s) { uint16_t length = EIGRP_TLV_SEQ_BASE_LEN; - struct eigrp *eigrp; struct eigrp_interface *ei; struct listnode *node, *node2, *nnode2; struct eigrp_neighbor *nbr; size_t backup_end, size_end; int found; - eigrp = eigrp_lookup(); - if (eigrp == NULL) { - return 0; - } - // add in the parameters TLV backup_end = stream_get_endp(s); stream_putw(s, EIGRP_TLV_SEQ); @@ -541,15 +536,10 @@ static uint16_t eigrp_sequence_encode(struct stream *s) * Part of conditional receive process * */ -static uint16_t eigrp_next_sequence_encode(struct stream *s) +static uint16_t eigrp_next_sequence_encode(struct eigrp *eigrp, + struct stream *s) { uint16_t length = EIGRP_NEXT_SEQUENCE_TLV_SIZE; - struct eigrp *eigrp; - - eigrp = eigrp_lookup(); - if (eigrp == NULL) { - return 0; - } // add in the parameters TLV stream_putw(s, EIGRP_TLV_NEXT_MCAST_SEQ); @@ -659,8 +649,8 @@ static struct eigrp_packet *eigrp_hello_encode(struct eigrp_interface *ei, length += eigrp_sw_version_encode(ep->s); if (flags & EIGRP_HELLO_ADD_SEQUENCE) { - length += eigrp_sequence_encode(ep->s); - length += eigrp_next_sequence_encode(ep->s); + length += eigrp_sequence_encode(ei->eigrp, ep->s); + length += eigrp_next_sequence_encode(ei->eigrp, ep->s); } // add in the TID list if doing multi-topology |
