Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163512886
D41824.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41824.id.diff
View Options
diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -785,7 +785,7 @@
int op_flags, struct rib_cmd_info *rc)
{
struct route_nhop_data rnd_orig;
- struct nhop_object *nh;
+ struct nhop_object *nh, *nh_orig;
struct rtentry *rt_orig;
int error = 0;
@@ -829,6 +829,23 @@
goto out;
}
+ nh_orig = rt_orig->rt_nhop;
+ /*
+ * For append or create, if both rt have gateway flag and they gw addrs
+ * are the same, they actually are the same route. We can either return
+ * existing erro or change to do replace that can save the new property.
+ * Here we prefer to return error and ignore the property change,
+ * because it can inform the caller error, if he want to change the
+ * existing route propery, he should select RTM_REPLACE op_flag
+ */
+ if ((nh->nh_flags & NHF_GATEWAY) &&
+ (nh_orig->nh_flags & NHF_GATEWAY) &&
+ match_nhop_gw(nh, &rt_orig->rt_nhop->gw_sa)) {
+ RIB_WUNLOCK(rnh);
+ error = EEXIST;
+ goto out;
+ }
+
RIB_WUNLOCK(rnh);
#ifdef ROUTE_MPATH
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 12:03 AM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35456726
Default Alt Text
D41824.id.diff (1 KB)
Attached To
Mode
D41824: filter the duplicated route add
Attached
Detach File
Event Timeline
Log In to Comment