summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 25d54a8553..652c47387a 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -8387,6 +8387,9 @@ DEFUN (ospf_default_information_originate,
int metric = -1;
struct ospf_redist *red;
int idx = 0;
+ int cur_originate = ospf->default_originate;
+ int sameRtmap = 0;
+ char *rtmap = NULL;
red = ospf_redist_add(ospf, DEFAULT_ROUTE, 0);
@@ -8408,7 +8411,28 @@ DEFUN (ospf_default_information_originate,
idx = 1;
/* Get route-map */
if (argv_find(argv, argc, "WORD", &idx))
- ospf_routemap_set(red, argv[idx]->arg);
+ rtmap = argv[idx]->arg;
+
+ /* To check ,if user is providing same route map */
+ if ((rtmap == ROUTEMAP_NAME(red)) ||
+ (rtmap && ROUTEMAP_NAME(red)
+ && (strcmp(rtmap, ROUTEMAP_NAME(red)) == 0)))
+ sameRtmap = 1;
+
+ /* Don't allow if the same lsa is aleardy originated. */
+ if ((sameRtmap)
+ && (red->dmetric.type == type)
+ && (red->dmetric.value == metric)
+ && (cur_originate == default_originate))
+ return CMD_SUCCESS;
+
+ /* Updating Metric details */
+ red->dmetric.type = type;
+ red->dmetric.value = metric;
+
+ /* updating route map details */
+ if (rtmap)
+ ospf_routemap_set(red, rtmap);
else
ospf_routemap_unset(red);