[Xorp-hackers] [PATCH 1/2] xorp: fea: data_plane: ifconfig: Check if we can set destination address for vif(IPv6)
igorm at etf.rs
igorm at etf.rs
Fri Mar 23 09:03:39 PDT 2012
From: Igor Maravic <igorm at etf.rs>
If our vif on system isn't point-to-point link
we can't set appropriate destination address. Commit will fail in that case.
Signed-off-by: Igor Maravic <igorm at etf.rs>
---
xorp/fea/data_plane/ifconfig/ifconfig_set.cc | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/xorp/fea/data_plane/ifconfig/ifconfig_set.cc b/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
index 046ab3e..75013da 100644
--- a/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
+++ b/xorp/fea/data_plane/ifconfig/ifconfig_set.cc
@@ -706,6 +706,15 @@ 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;
+ }
+ }
+
//
// XXX: For whatever reason a prefix length of zero does not cut it, so
// initialize prefix to 64. This is exactly what ifconfig(8) does.
--
1.7.5.4
More information about the Xorp-hackers
mailing list