[Xorp-hackers] [PATCH] xorp: fea: data_plane: ifconfig: Fix checking if interface can have broadcast address
igorm at etf.rs
igorm at etf.rs
Tue Mar 27 03:42:07 PDT 2012
From: Igor Maravic <igorm at etf.rs>
Signed-off-by: Igor Maravic <igorm at etf.rs>
---
xorp/fea/data_plane/ifconfig/ifconfig_set.cc | 30 +++++++++++++-------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/xorp/fea/data_plane/ifconfig/ifconfig_set.cc b/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
index 75013da..108b612 100644
--- a/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
+++ b/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
@@ -595,21 +595,6 @@ IfConfigSet::push_vif_address(const IfTreeInterface* system_ifp,
is_add = false;
}
- if (system_vifp != NULL) {
- if (system_vifp->point_to_point() != config_addr.point_to_point()) {
- error_msg = c_format("Can't set destination address for if: %s vif: %s"
- "because it isn't point-to-point interface\n",
- system_ifp->ifname().c_str(), system_vifp->vifname().c_str());
- goto done;
- }
- if (system_vifp->broadcast() != config_addr.broadcast()) {
- error_msg = c_format("Can't set broadcast address for if: %s vif: %s"
- "because it isn't broadcast capable\n",
- system_ifp->ifname().c_str(), system_vifp->vifname().c_str());
- goto done;
- }
- }
-
//
// XXX: If the broadcast address was omitted, recompute and set it here.
// Note that we recompute it only if the underlying vif is
@@ -625,6 +610,21 @@ IfConfigSet::push_vif_address(const IfTreeInterface* system_ifp,
config_addr.set_broadcast(true);
}
+ if (system_vifp != NULL) {
+ if (system_vifp->point_to_point() != config_addr.point_to_point()) {
+ error_msg = c_format("Can't set destination address for if: %s vif: %s"
+ "because it isn't point-to-point interface\n",
+ system_ifp->ifname().c_str(), system_vifp->vifname().c_str());
+ goto done;
+ }
+ if (system_vifp->broadcast() != config_addr.broadcast()) {
+ error_msg = c_format("Can't set broadcast address for if: %s vif: %s"
+ "because it isn't broadcast capable\n",
+ system_ifp->ifname().c_str(), system_vifp->vifname().c_str());
+ goto done;
+ }
+ }
+
//
// Push the address configuration: either add/update or delete it.
//
--
1.7.5.4
More information about the Xorp-hackers
mailing list