mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
eigrpd: Cleanup a bunch SA warnings.
1) Cleanup SA warnings, more to come 2) Cleanup some non debug guarded zlog_info code Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
46c3ce8327
commit
057fad8dfb
@ -310,10 +310,15 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp)
|
|||||||
void
|
void
|
||||||
show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn)
|
show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn)
|
||||||
{
|
{
|
||||||
|
struct list *successors = eigrp_topology_get_successor(tn);
|
||||||
|
|
||||||
vty_out (vty, "%-3c",(tn->state > 0) ? 'A' : 'P');
|
vty_out (vty, "%-3c",(tn->state > 0) ? 'A' : 'P');
|
||||||
vty_out (vty, "%s/%u, ",inet_ntoa (tn->destination_ipv4->prefix),tn->destination_ipv4->prefixlen);
|
vty_out (vty, "%s/%u, ",
|
||||||
vty_out (vty, "%u successors, ",eigrp_topology_get_successor(tn)->count);
|
inet_ntoa (tn->destination_ipv4->prefix), tn->destination_ipv4->prefixlen);
|
||||||
vty_out (vty, "FD is %u, serno: %lu %s",tn->fdistance, tn->serno, VTY_NEWLINE);
|
vty_out (vty, "%u successors, ", successors->count);
|
||||||
|
vty_out (vty, "FD is %u, serno: %lu %s", tn->fdistance, tn->serno, VTY_NEWLINE);
|
||||||
|
|
||||||
|
list_delete(successors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -83,7 +83,6 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
if (dist->list[DISTRIBUTE_V4_IN])
|
if (dist->list[DISTRIBUTE_V4_IN])
|
||||||
{
|
{
|
||||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
||||||
zlog_info("<DEBUG DISTRIBUTE ACL IN FOUND: %s",alist->name);
|
|
||||||
if (alist)
|
if (alist)
|
||||||
e->list[EIGRP_FILTER_IN] = alist;
|
e->list[EIGRP_FILTER_IN] = alist;
|
||||||
else
|
else
|
||||||
@ -97,7 +96,6 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
/* access list OUT for whole process */
|
/* access list OUT for whole process */
|
||||||
if (dist->list[DISTRIBUTE_V4_OUT])
|
if (dist->list[DISTRIBUTE_V4_OUT])
|
||||||
{
|
{
|
||||||
zlog_info("<DEBUG DISTRIBUTE ACL OUT FOUND: %s",dist->list[DISTRIBUTE_V4_OUT]);
|
|
||||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_OUT]);
|
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_OUT]);
|
||||||
if (alist)
|
if (alist)
|
||||||
e->list[EIGRP_FILTER_OUT] = alist;
|
e->list[EIGRP_FILTER_OUT] = alist;
|
||||||
@ -112,7 +110,6 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
/* PREFIX_LIST IN for process */
|
/* PREFIX_LIST IN for process */
|
||||||
if (dist->prefix[DISTRIBUTE_V4_IN])
|
if (dist->prefix[DISTRIBUTE_V4_IN])
|
||||||
{
|
{
|
||||||
zlog_info("<DEBUG DISTRIBUTE PREFIX IN FOUND: %s",dist->prefix[DISTRIBUTE_V4_IN]);
|
|
||||||
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_IN]);
|
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_IN]);
|
||||||
if (plist)
|
if (plist)
|
||||||
{
|
{
|
||||||
@ -126,7 +123,6 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
/* PREFIX_LIST OUT for process */
|
/* PREFIX_LIST OUT for process */
|
||||||
if (dist->prefix[DISTRIBUTE_V4_OUT])
|
if (dist->prefix[DISTRIBUTE_V4_OUT])
|
||||||
{
|
{
|
||||||
zlog_info("<DEBUG DISTRIBUTE PREFIX OUT FOUND: %s",dist->prefix[DISTRIBUTE_V4_OUT]);
|
|
||||||
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_OUT]);
|
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_OUT]);
|
||||||
if (plist)
|
if (plist)
|
||||||
{
|
{
|
||||||
@ -192,8 +188,6 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
if (ifp == NULL)
|
if (ifp == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
zlog_info("<DEBUG ACL 2");
|
|
||||||
|
|
||||||
/*struct eigrp_if_info * info = ifp->info;
|
/*struct eigrp_if_info * info = ifp->info;
|
||||||
ei = info->eigrp_interface;*/
|
ei = info->eigrp_interface;*/
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
@ -207,15 +201,9 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ei == NULL)
|
|
||||||
{
|
|
||||||
zlog_info("Not Found eigrp interface %s",ifp->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Access-list for interface in */
|
/* Access-list for interface in */
|
||||||
if (dist->list[DISTRIBUTE_V4_IN])
|
if (dist->list[DISTRIBUTE_V4_IN])
|
||||||
{
|
{
|
||||||
zlog_info("<DEBUG ACL in");
|
|
||||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
||||||
if (alist){
|
if (alist){
|
||||||
ei->list[EIGRP_FILTER_IN] = alist;
|
ei->list[EIGRP_FILTER_IN] = alist;
|
||||||
@ -239,10 +227,7 @@ eigrp_distribute_update (struct distribute *dist)
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
ei->list[EIGRP_FILTER_OUT] = NULL;
|
||||||
ei->list[EIGRP_FILTER_OUT] = NULL;
|
|
||||||
zlog_info("<DEBUG ACL out else");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Prefix-list for interface in */
|
/* Prefix-list for interface in */
|
||||||
if (dist->prefix[DISTRIBUTE_V4_IN])
|
if (dist->prefix[DISTRIBUTE_V4_IN])
|
||||||
|
@ -252,7 +252,8 @@ eigrp_peer_termination_decode (struct eigrp_neighbor *nbr,
|
|||||||
if(my_ip == received_ip)
|
if(my_ip == received_ip)
|
||||||
{
|
{
|
||||||
zlog_info ("Neighbor %s (%s) is down: Peer Termination received",
|
zlog_info ("Neighbor %s (%s) is down: Peer Termination received",
|
||||||
inet_ntoa (nbr->src),ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
|
inet_ntoa (nbr->src),
|
||||||
|
ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
|
||||||
/* set neighbor to DOWN */
|
/* set neighbor to DOWN */
|
||||||
nbr->state = EIGRP_NEIGHBOR_DOWN;
|
nbr->state = EIGRP_NEIGHBOR_DOWN;
|
||||||
/* delete neighbor */
|
/* delete neighbor */
|
||||||
@ -364,14 +365,15 @@ eigrp_hello_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
|||||||
case EIGRP_TLV_SW_VERSION:
|
case EIGRP_TLV_SW_VERSION:
|
||||||
eigrp_sw_version_decode(nbr, tlv_header);
|
eigrp_sw_version_decode(nbr, tlv_header);
|
||||||
break;
|
break;
|
||||||
case EIGRP_TLV_NEXT_MCAST_SEQ:
|
case EIGRP_TLV_NEXT_MCAST_SEQ:
|
||||||
break;
|
break;
|
||||||
case EIGRP_TLV_PEER_TERMINATION:
|
case EIGRP_TLV_PEER_TERMINATION:
|
||||||
eigrp_peer_termination_decode(nbr, tlv_header);
|
eigrp_peer_termination_decode(nbr, tlv_header);
|
||||||
|
return;
|
||||||
break;
|
break;
|
||||||
case EIGRP_TLV_PEER_MTRLIST:
|
case EIGRP_TLV_PEER_MTRLIST:
|
||||||
case EIGRP_TLV_PEER_TIDLIST:
|
case EIGRP_TLV_PEER_TIDLIST:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -388,7 +390,8 @@ eigrp_hello_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
|||||||
{
|
{
|
||||||
/* increment statistics. */
|
/* increment statistics. */
|
||||||
ei->hello_in++;
|
ei->hello_in++;
|
||||||
eigrp_nbr_state_update(nbr);
|
if (nbr)
|
||||||
|
eigrp_nbr_state_update(nbr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,9 @@ eigrp_if_up (struct eigrp_interface *ei)
|
|||||||
{
|
{
|
||||||
pe = eigrp_prefix_entry_new ();
|
pe = eigrp_prefix_entry_new ();
|
||||||
pe->serno = eigrp->serno;
|
pe->serno = eigrp->serno;
|
||||||
pe->destination_ipv4 = dest_addr;
|
pe->destination_ipv4 = prefix_ipv4_new ();
|
||||||
|
prefix_copy ((struct prefix *)pe->destination_ipv4,
|
||||||
|
(struct prefix *)&dest_addr);
|
||||||
pe->af = AF_INET;
|
pe->af = AF_INET;
|
||||||
pe->nt = EIGRP_TOPOLOGY_TYPE_CONNECTED;
|
pe->nt = EIGRP_TOPOLOGY_TYPE_CONNECTED;
|
||||||
|
|
||||||
|
@ -114,7 +114,10 @@ eigrp_make_md5_digest (struct eigrp_interface *ei, struct stream *s, u_char flag
|
|||||||
if(keychain)
|
if(keychain)
|
||||||
key = key_lookup_for_send(keychain);
|
key = key_lookup_for_send(keychain);
|
||||||
else
|
else
|
||||||
return EIGRP_AUTH_TYPE_NONE;
|
{
|
||||||
|
eigrp_authTLV_MD5_free(auth_TLV);
|
||||||
|
return EIGRP_AUTH_TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&ctx, 0, sizeof(ctx));
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
MD5Init(&ctx);
|
MD5Init(&ctx);
|
||||||
@ -235,8 +238,7 @@ eigrp_check_md5_digest (struct stream *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* save neighbor's crypt_seqnum */
|
/* save neighbor's crypt_seqnum */
|
||||||
if (nbr)
|
nbr->crypt_seqnum = authTLV->key_sequence;
|
||||||
nbr->crypt_seqnum = authTLV->key_sequence;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -628,7 +630,7 @@ eigrp_read (struct thread *thread)
|
|||||||
struct eigrp_packet *ep;
|
struct eigrp_packet *ep;
|
||||||
|
|
||||||
ep = eigrp_fifo_tail(nbr->retrans_queue);
|
ep = eigrp_fifo_tail(nbr->retrans_queue);
|
||||||
if (ep != NULL)
|
if (ep)
|
||||||
{
|
{
|
||||||
if (ntohl(eigrph->ack) == ep->sequence_number)
|
if (ntohl(eigrph->ack) == ep->sequence_number)
|
||||||
{
|
{
|
||||||
@ -642,7 +644,7 @@ eigrp_read (struct thread *thread)
|
|||||||
eigrp_update_send_EOT(nbr);
|
eigrp_update_send_EOT(nbr);
|
||||||
}
|
}
|
||||||
ep = eigrp_fifo_pop_tail(nbr->retrans_queue);
|
ep = eigrp_fifo_pop_tail(nbr->retrans_queue);
|
||||||
/*eigrp_packet_free(ep);*/
|
eigrp_packet_free(ep);
|
||||||
if (nbr->retrans_queue->count > 0)
|
if (nbr->retrans_queue->count > 0)
|
||||||
{
|
{
|
||||||
eigrp_send_packet_reliably(nbr);
|
eigrp_send_packet_reliably(nbr);
|
||||||
@ -650,7 +652,7 @@ eigrp_read (struct thread *thread)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ep = eigrp_fifo_tail(nbr->multicast_queue);
|
ep = eigrp_fifo_tail(nbr->multicast_queue);
|
||||||
if (ep != NULL)
|
if (ep)
|
||||||
{
|
{
|
||||||
if (ntohl(eigrph->ack) == ep->sequence_number)
|
if (ntohl(eigrph->ack) == ep->sequence_number)
|
||||||
{
|
{
|
||||||
|
@ -114,16 +114,17 @@ eigrp_query_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
|||||||
type = stream_getw(s);
|
type = stream_getw(s);
|
||||||
if (type == EIGRP_TLV_IPv4_INT)
|
if (type == EIGRP_TLV_IPv4_INT)
|
||||||
{
|
{
|
||||||
|
struct prefix_ipv4 dest_addr;
|
||||||
|
|
||||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||||
|
|
||||||
tlv = eigrp_read_ipv4_tlv(s);
|
tlv = eigrp_read_ipv4_tlv(s);
|
||||||
|
|
||||||
struct prefix_ipv4 *dest_addr;
|
dest_addr.family = AFI_IP;
|
||||||
dest_addr = prefix_ipv4_new();
|
dest_addr.prefix = tlv->destination;
|
||||||
dest_addr->prefix = tlv->destination;
|
dest_addr.prefixlen = tlv->prefix_length;
|
||||||
dest_addr->prefixlen = tlv->prefix_length;
|
|
||||||
struct eigrp_prefix_entry *dest =
|
struct eigrp_prefix_entry *dest =
|
||||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||||
|
|
||||||
/* If the destination exists (it should, but one never know)*/
|
/* If the destination exists (it should, but one never know)*/
|
||||||
if (dest != NULL)
|
if (dest != NULL)
|
||||||
|
@ -146,6 +146,8 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
|||||||
{
|
{
|
||||||
eigrp_send_packet_reliably(nbr);
|
eigrp_send_packet_reliably(nbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XFREE(MTYPE_EIGRP_PREFIX_ENTRY, pe2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*EIGRP REPLY read function*/
|
/*EIGRP REPLY read function*/
|
||||||
@ -180,16 +182,17 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
|||||||
type = stream_getw(s);
|
type = stream_getw(s);
|
||||||
if (type == EIGRP_TLV_IPv4_INT)
|
if (type == EIGRP_TLV_IPv4_INT)
|
||||||
{
|
{
|
||||||
|
struct prefix_ipv4 dest_addr;
|
||||||
|
|
||||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||||
|
|
||||||
tlv = eigrp_read_ipv4_tlv(s);
|
tlv = eigrp_read_ipv4_tlv(s);
|
||||||
|
|
||||||
struct prefix_ipv4 *dest_addr;
|
dest_addr.family = AFI_IP;
|
||||||
dest_addr = prefix_ipv4_new();
|
dest_addr.prefix = tlv->destination;
|
||||||
dest_addr->prefix = tlv->destination;
|
dest_addr.prefixlen = tlv->prefix_length;
|
||||||
dest_addr->prefixlen = tlv->prefix_length;
|
|
||||||
struct eigrp_prefix_entry *dest =
|
struct eigrp_prefix_entry *dest =
|
||||||
eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, dest_addr);
|
eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, &dest_addr);
|
||||||
/*
|
/*
|
||||||
* Destination must exists
|
* Destination must exists
|
||||||
*/
|
*/
|
||||||
@ -212,24 +215,18 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
|||||||
plist = e->prefix[EIGRP_FILTER_IN];
|
plist = e->prefix[EIGRP_FILTER_IN];
|
||||||
alist_i = ei->list[EIGRP_FILTER_IN];
|
alist_i = ei->list[EIGRP_FILTER_IN];
|
||||||
plist_i = ei->prefix[EIGRP_FILTER_IN];
|
plist_i = ei->prefix[EIGRP_FILTER_IN];
|
||||||
zlog_info("REPLY Receive: Filtering");
|
|
||||||
zlog_info("REPLY RECEIVE Prefix: %s", inet_ntoa(dest_addr->prefix));
|
|
||||||
/* Check if any list fits */
|
/* Check if any list fits */
|
||||||
if ((alist && access_list_apply (alist,
|
if ((alist &&
|
||||||
(struct prefix *) dest_addr) == FILTER_DENY)||
|
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY) ||
|
||||||
(plist && prefix_list_apply (plist,
|
(plist &&
|
||||||
(struct prefix *) dest_addr) == PREFIX_DENY)||
|
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY) ||
|
||||||
(alist_i && access_list_apply (alist_i,
|
(alist_i &&
|
||||||
(struct prefix *) dest_addr) == FILTER_DENY)||
|
access_list_apply (alist_i, (struct prefix *)&dest_addr) == FILTER_DENY) ||
|
||||||
(plist_i && prefix_list_apply (plist_i,
|
(plist_i &&
|
||||||
(struct prefix *) dest_addr) == PREFIX_DENY))
|
prefix_list_apply (plist_i, (struct prefix *)&dest_addr) == PREFIX_DENY))
|
||||||
{
|
{
|
||||||
zlog_info("REPLY RECEIVE: Setting metric to max");
|
|
||||||
tlv->metric.delay = EIGRP_MAX_METRIC;
|
tlv->metric.delay = EIGRP_MAX_METRIC;
|
||||||
zlog_info("REPLY RECEIVE Prefix: %s", inet_ntoa(dest_addr->prefix));
|
}
|
||||||
} else {
|
|
||||||
zlog_info("REPLY RECEIVE: Not setting metric");
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* End of filtering
|
* End of filtering
|
||||||
*/
|
*/
|
||||||
|
@ -81,16 +81,17 @@ eigrp_siaquery_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
|
|||||||
type = stream_getw(s);
|
type = stream_getw(s);
|
||||||
if (type == EIGRP_TLV_IPv4_INT)
|
if (type == EIGRP_TLV_IPv4_INT)
|
||||||
{
|
{
|
||||||
|
struct prefix_ipv4 dest_addr;
|
||||||
|
|
||||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||||
|
|
||||||
tlv = eigrp_read_ipv4_tlv(s);
|
tlv = eigrp_read_ipv4_tlv(s);
|
||||||
|
|
||||||
struct prefix_ipv4 *dest_addr;
|
dest_addr.family = AFI_IP;
|
||||||
dest_addr = prefix_ipv4_new();
|
dest_addr.prefix = tlv->destination;
|
||||||
dest_addr->prefix = tlv->destination;
|
dest_addr.prefixlen = tlv->prefix_length;
|
||||||
dest_addr->prefixlen = tlv->prefix_length;
|
|
||||||
struct eigrp_prefix_entry *dest =
|
struct eigrp_prefix_entry *dest =
|
||||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||||
|
|
||||||
/* If the destination exists (it should, but one never know)*/
|
/* If the destination exists (it should, but one never know)*/
|
||||||
if (dest != NULL)
|
if (dest != NULL)
|
||||||
@ -162,4 +163,6 @@ eigrp_send_siaquery (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
|||||||
eigrp_send_packet_reliably(nbr);
|
eigrp_send_packet_reliably(nbr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
eigrp_packet_free(ep);
|
||||||
}
|
}
|
||||||
|
@ -80,16 +80,17 @@ eigrp_siareply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
|
|||||||
type = stream_getw(s);
|
type = stream_getw(s);
|
||||||
if (type == EIGRP_TLV_IPv4_INT)
|
if (type == EIGRP_TLV_IPv4_INT)
|
||||||
{
|
{
|
||||||
|
struct prefix_ipv4 dest_addr;
|
||||||
|
|
||||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||||
|
|
||||||
tlv = eigrp_read_ipv4_tlv(s);
|
tlv = eigrp_read_ipv4_tlv(s);
|
||||||
|
|
||||||
struct prefix_ipv4 *dest_addr;
|
dest_addr.family = AFI_IP;
|
||||||
dest_addr = prefix_ipv4_new();
|
dest_addr.prefix = tlv->destination;
|
||||||
dest_addr->prefix = tlv->destination;
|
dest_addr.prefixlen = tlv->prefix_length;
|
||||||
dest_addr->prefixlen = tlv->prefix_length;
|
|
||||||
struct eigrp_prefix_entry *dest =
|
struct eigrp_prefix_entry *dest =
|
||||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||||
|
|
||||||
/* If the destination exists (it should, but one never know)*/
|
/* If the destination exists (it should, but one never know)*/
|
||||||
if (dest != NULL)
|
if (dest != NULL)
|
||||||
@ -161,6 +162,8 @@ eigrp_send_siareply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
|||||||
eigrp_send_packet_reliably(nbr);
|
eigrp_send_packet_reliably(nbr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
eigrp_packet_free(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -291,17 +291,18 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
|||||||
type = stream_getw(s);
|
type = stream_getw(s);
|
||||||
if (type == EIGRP_TLV_IPv4_INT)
|
if (type == EIGRP_TLV_IPv4_INT)
|
||||||
{
|
{
|
||||||
|
struct prefix_ipv4 dest_addr;
|
||||||
|
|
||||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||||
|
|
||||||
tlv = eigrp_read_ipv4_tlv(s);
|
tlv = eigrp_read_ipv4_tlv(s);
|
||||||
|
|
||||||
/*searching if destination exists */
|
/*searching if destination exists */
|
||||||
struct prefix_ipv4 *dest_addr;
|
dest_addr.family = AFI_IP;
|
||||||
dest_addr = prefix_ipv4_new();
|
dest_addr.prefix = tlv->destination;
|
||||||
dest_addr->prefix = tlv->destination;
|
dest_addr.prefixlen = tlv->prefix_length;
|
||||||
dest_addr->prefixlen = tlv->prefix_length;
|
|
||||||
struct eigrp_prefix_entry *dest =
|
struct eigrp_prefix_entry *dest =
|
||||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||||
|
|
||||||
/*if exists it comes to DUAL*/
|
/*if exists it comes to DUAL*/
|
||||||
if (dest != NULL)
|
if (dest != NULL)
|
||||||
@ -331,7 +332,9 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
|||||||
/*Here comes topology information save*/
|
/*Here comes topology information save*/
|
||||||
pe = eigrp_prefix_entry_new();
|
pe = eigrp_prefix_entry_new();
|
||||||
pe->serno = eigrp->serno;
|
pe->serno = eigrp->serno;
|
||||||
pe->destination_ipv4 = dest_addr;
|
pe->destination_ipv4 = prefix_ipv4_new();
|
||||||
|
prefix_copy((struct prefix *)pe->destination_ipv4,
|
||||||
|
(struct prefix *)&dest_addr);
|
||||||
pe->af = AF_INET;
|
pe->af = AF_INET;
|
||||||
pe->state = EIGRP_FSM_STATE_PASSIVE;
|
pe->state = EIGRP_FSM_STATE_PASSIVE;
|
||||||
pe->nt = EIGRP_TOPOLOGY_TYPE_REMOTE;
|
pe->nt = EIGRP_TOPOLOGY_TYPE_REMOTE;
|
||||||
@ -353,93 +356,52 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
|||||||
*/
|
*/
|
||||||
alist = ei->list[EIGRP_FILTER_IN];
|
alist = ei->list[EIGRP_FILTER_IN];
|
||||||
|
|
||||||
if (alist) {
|
|
||||||
zlog_info ("ALIST PROC IN: %s", alist->name);
|
|
||||||
} else {
|
|
||||||
zlog_info("ALIST je prazdny");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if access-list fits */
|
/* Check if access-list fits */
|
||||||
if (alist && access_list_apply (alist,
|
if (alist &&
|
||||||
(struct prefix *) dest_addr) == FILTER_DENY)
|
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY)
|
||||||
{
|
{
|
||||||
/* If yes, set reported metric to Max */
|
/* If yes, set reported metric to Max */
|
||||||
zlog_info("PROC IN: Nastavujem metriku na MAX");
|
|
||||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||||
zlog_info("PROC IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
|
||||||
} else {
|
} else {
|
||||||
zlog_info("PROC IN: NENastavujem metriku ");
|
|
||||||
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
||||||
}
|
}
|
||||||
|
|
||||||
plist = e->prefix[EIGRP_FILTER_IN];
|
plist = e->prefix[EIGRP_FILTER_IN];
|
||||||
|
|
||||||
if (plist) {
|
|
||||||
zlog_info ("PLIST PROC IN: %s", plist->name);
|
|
||||||
} else {
|
|
||||||
zlog_info("PLIST PROC IN je prazdny");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if prefix-list fits */
|
/* Check if prefix-list fits */
|
||||||
if (plist && prefix_list_apply (plist,
|
if (plist &&
|
||||||
(struct prefix *) dest_addr) == PREFIX_DENY)
|
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY)
|
||||||
{
|
{
|
||||||
/* If yes, set reported metric to Max */
|
/* If yes, set reported metric to Max */
|
||||||
zlog_info("PLIST PROC IN: Nastavujem metriku na MAX");
|
|
||||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||||
zlog_info("PLIST PROC IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
}
|
||||||
} else {
|
|
||||||
zlog_info("PLIST PROC IN: NENastavujem metriku ");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Get access-list from current interface */
|
/*Get access-list from current interface */
|
||||||
zlog_info("Checking access_list on interface: %s",ei->ifp->name);
|
|
||||||
alist = ei->list[EIGRP_FILTER_IN];
|
alist = ei->list[EIGRP_FILTER_IN];
|
||||||
if (alist) {
|
|
||||||
zlog_info ("ALIST INT IN: %s", alist->name);
|
|
||||||
} else {
|
|
||||||
zlog_info("ALIST INT IN je prazdny");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if access-list fits */
|
/* Check if access-list fits */
|
||||||
if (alist && access_list_apply (alist, (struct prefix *) dest_addr) == FILTER_DENY)
|
if (alist &&
|
||||||
|
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY)
|
||||||
{
|
{
|
||||||
/* If yes, set reported metric to Max */
|
/* If yes, set reported metric to Max */
|
||||||
zlog_info("INT IN: Nastavujem metriku na MAX");
|
|
||||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||||
zlog_info("INT IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
}
|
||||||
} else {
|
|
||||||
zlog_info("INT IN: NENastavujem metriku ");
|
|
||||||
}
|
|
||||||
|
|
||||||
plist = ei->prefix[EIGRP_FILTER_IN];
|
plist = ei->prefix[EIGRP_FILTER_IN];
|
||||||
|
|
||||||
if (plist) {
|
|
||||||
zlog_info ("PLIST INT IN: %s", plist->name);
|
|
||||||
} else {
|
|
||||||
zlog_info("PLIST INT IN je prazdny");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if prefix-list fits */
|
/* Check if prefix-list fits */
|
||||||
if (plist && prefix_list_apply (plist,
|
if (plist &&
|
||||||
(struct prefix *) dest_addr) == PREFIX_DENY)
|
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY)
|
||||||
{
|
{
|
||||||
/* If yes, set reported metric to Max */
|
/* If yes, set reported metric to Max */
|
||||||
zlog_info("PLIST INT IN: Nastavujem metriku na MAX");
|
|
||||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||||
zlog_info("PLIST INT IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
}
|
||||||
} else {
|
|
||||||
zlog_info("PLIST INT IN: NENastavujem metriku ");
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* End of filtering
|
* End of filtering
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
||||||
|
|
||||||
zlog_info("<DEBUG PROC IN Distance: %x", ne->distance);
|
|
||||||
zlog_info("<DEBUG PROC IN Delay: %x", ne->total_metric.delay);
|
|
||||||
|
|
||||||
pe->fdistance = pe->distance = pe->rdistance =
|
pe->fdistance = pe->distance = pe->rdistance =
|
||||||
ne->distance;
|
ne->distance;
|
||||||
ne->prefix = pe;
|
ne->prefix = pe;
|
||||||
@ -669,6 +631,7 @@ eigrp_update_send (struct eigrp_interface *ei)
|
|||||||
struct prefix_list *plist_i;
|
struct prefix_list *plist_i;
|
||||||
struct eigrp *e;
|
struct eigrp *e;
|
||||||
struct prefix_ipv4 *dest_addr;
|
struct prefix_ipv4 *dest_addr;
|
||||||
|
bool packet_sent = false;
|
||||||
|
|
||||||
u_int16_t length = EIGRP_HEADER_LEN;
|
u_int16_t length = EIGRP_HEADER_LEN;
|
||||||
|
|
||||||
@ -740,7 +703,8 @@ eigrp_update_send (struct eigrp_interface *ei)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
|
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5)
|
||||||
|
&& (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
|
||||||
{
|
{
|
||||||
eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
|
eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
|
||||||
}
|
}
|
||||||
@ -762,6 +726,7 @@ eigrp_update_send (struct eigrp_interface *ei)
|
|||||||
{
|
{
|
||||||
if (nbr->state == EIGRP_NEIGHBOR_UP)
|
if (nbr->state == EIGRP_NEIGHBOR_UP)
|
||||||
{
|
{
|
||||||
|
packet_sent = true;
|
||||||
/*Put packet to retransmission queue*/
|
/*Put packet to retransmission queue*/
|
||||||
eigrp_fifo_push_head(nbr->retrans_queue, ep);
|
eigrp_fifo_push_head(nbr->retrans_queue, ep);
|
||||||
|
|
||||||
@ -771,6 +736,9 @@ eigrp_update_send (struct eigrp_interface *ei)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!packet_sent)
|
||||||
|
eigrp_packet_free(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user