summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eigrpd/eigrp_query.c2
-rw-r--r--eigrpd/eigrp_reply.c2
-rw-r--r--eigrpd/eigrp_siaquery.c2
-rw-r--r--eigrpd/eigrp_siareply.c2
-rw-r--r--eigrpd/eigrp_structs.h5
-rw-r--r--eigrpd/eigrp_topology.c61
-rw-r--r--eigrpd/eigrp_update.c6
7 files changed, 36 insertions, 44 deletions
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
index 92aa7f9855..4757097315 100644
--- a/eigrpd/eigrp_query.c
+++ b/eigrpd/eigrp_query.c
@@ -133,7 +133,7 @@ void eigrp_query_receive(struct eigrp *eigrp, struct ip *iph,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = dest;
eigrp_fsm_event(&msg);
diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c
index 92cea77305..304a1a5242 100644
--- a/eigrpd/eigrp_reply.c
+++ b/eigrpd/eigrp_reply.c
@@ -239,7 +239,7 @@ void eigrp_reply_receive(struct eigrp *eigrp, struct ip *iph,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = dest;
eigrp_fsm_event(&msg);
diff --git a/eigrpd/eigrp_siaquery.c b/eigrpd/eigrp_siaquery.c
index 60decc5bef..cd04f88595 100644
--- a/eigrpd/eigrp_siaquery.c
+++ b/eigrpd/eigrp_siaquery.c
@@ -102,7 +102,7 @@ void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = dest;
eigrp_fsm_event(&msg);
diff --git a/eigrpd/eigrp_siareply.c b/eigrpd/eigrp_siareply.c
index e960940200..5e83549488 100644
--- a/eigrpd/eigrp_siareply.c
+++ b/eigrpd/eigrp_siareply.c
@@ -101,7 +101,7 @@ void eigrp_siareply_receive(struct eigrp *eigrp, struct ip *iph,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = dest;
eigrp_fsm_event(&msg);
diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h
index c81dfebb46..6bb0c5cc2b 100644
--- a/eigrpd/eigrp_structs.h
+++ b/eigrpd/eigrp_structs.h
@@ -514,10 +514,7 @@ struct eigrp_fsm_action_message {
struct eigrp_neighbor_entry *entry;
struct eigrp_prefix_entry *prefix;
msg_data_t data_type; // internal or external tlv type
- union {
- struct TLV_IPv4_External_type *ipv4_ext_data;
- struct TLV_IPv4_Internal_type *ipv4_int_type;
- } data;
+ struct eigrp_metrics metrics;
};
#endif /* _ZEBRA_EIGRP_STRUCTURES_H_ */
diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c
index 9f62e5e899..4555ced477 100644
--- a/eigrpd/eigrp_topology.c
+++ b/eigrpd/eigrp_topology.c
@@ -380,50 +380,45 @@ enum metric_change eigrp_topology_update_distance(struct eigrp_fsm_action_messag
struct eigrp_prefix_entry *prefix = msg->prefix;
struct eigrp_neighbor_entry *entry = msg->entry;
enum metric_change change = METRIC_SAME;
+ u_int32_t new_reported_distance;
+
assert(entry);
- struct TLV_IPv4_External_type *ext_data = NULL;
- struct TLV_IPv4_Internal_type *int_data = NULL;
switch(msg->data_type) {
case EIGRP_CONNECTED:
+ if (prefix->nt == EIGRP_TOPOLOGY_TYPE_CONNECTED)
+ return change;
+
+ change = METRIC_DECREASE;
break;
case EIGRP_INT:
- {
- u_int32_t new_reported_distance;
-
- int_data = msg->data.ipv4_int_type;
- if (eigrp_metrics_is_same(int_data->metric,
- entry->reported_metric)) {
- return change; // No change
- }
+ if (eigrp_metrics_is_same(msg->metrics,
+ entry->reported_metric)) {
+ return change; // No change
+ }
- new_reported_distance = eigrp_calculate_metrics(eigrp,
- int_data->metric);
+ new_reported_distance = eigrp_calculate_metrics(eigrp,
+ msg->metrics);
- if (entry->reported_distance < new_reported_distance)
- change = METRIC_INCREASE;
- else
- change = METRIC_DECREASE;
+ if (entry->reported_distance < new_reported_distance)
+ change = METRIC_INCREASE;
+ else
+ change = METRIC_DECREASE;
- entry->reported_metric = int_data->metric;
- entry->reported_distance = new_reported_distance;
- eigrp_calculate_metrics(eigrp, int_data->metric);
- entry->distance = eigrp_calculate_total_metrics(eigrp, entry);
- break;
- }
+ entry->reported_metric = msg->metrics;
+ entry->reported_distance = new_reported_distance;
+ eigrp_calculate_metrics(eigrp, msg->metrics);
+ entry->distance = eigrp_calculate_total_metrics(eigrp, entry);
+ break;
case EIGRP_EXT:
- {
- ext_data = msg->data.ipv4_ext_data;
-
- if (prefix->nt == EIGRP_TOPOLOGY_TYPE_REMOTE_EXTERNAL) {
- if (eigrp_metrics_is_same(ext_data->metric,
- entry->reported_metric))
- return change;
- } else
- change = METRIC_INCREASE;
+ if (prefix->nt == EIGRP_TOPOLOGY_TYPE_REMOTE_EXTERNAL) {
+ if (eigrp_metrics_is_same(msg->metrics,
+ entry->reported_metric))
+ return change;
+ } else
+ change = METRIC_INCREASE;
break;
- }
default:
zlog_err("%s: Please implement handler", __PRETTY_FUNCTION__);
break;
@@ -511,7 +506,7 @@ void eigrp_topology_neighbor_down(struct eigrp *eigrp,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = prefix;
eigrp_fsm_event(&msg);
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
index ba54fa5727..98bfc95e4d 100644
--- a/eigrpd/eigrp_update.c
+++ b/eigrpd/eigrp_update.c
@@ -141,7 +141,7 @@ static void eigrp_update_receive_GR_ask(struct eigrp *eigrp,
fsm_msg.eigrp = eigrp;
fsm_msg.data_type = EIGRP_INT;
fsm_msg.adv_router = nbr;
- fsm_msg.data.ipv4_int_type = tlv_max;
+ fsm_msg.metrics = tlv_max->metric;
fsm_msg.entry = entry;
fsm_msg.prefix = prefix;
@@ -317,7 +317,7 @@ void eigrp_update_receive(struct eigrp *eigrp, struct ip *iph,
msg.eigrp = eigrp;
msg.data_type = EIGRP_INT;
msg.adv_router = nbr;
- msg.data.ipv4_int_type = tlv;
+ msg.metrics = tlv->metric;
msg.entry = entry;
msg.prefix = dest;
eigrp_fsm_event(&msg);
@@ -980,7 +980,7 @@ static void eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
fsm_msg.eigrp = e;
fsm_msg.data_type = EIGRP_INT;
fsm_msg.adv_router = nbr;
- fsm_msg.data.ipv4_int_type = tlv_max;
+ fsm_msg.metrics = tlv_max->metric;
fsm_msg.entry = entry;
fsm_msg.prefix = pe;