summaryrefslogtreecommitdiff
path: root/lib/if_rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/if_rmap.c')
-rw-r--r--lib/if_rmap.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index ddc62fd5..7d049b87 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -109,14 +109,9 @@ if_rmap_get (const char *ifname)
static unsigned int
if_rmap_hash_make (void *data)
{
- struct if_rmap *if_rmap = data;
- unsigned int i, key;
+ const struct if_rmap *if_rmap = data;
- key = 0;
- for (i = 0; i < strlen (if_rmap->ifname); i++)
- key += if_rmap->ifname[i];
-
- return key;
+ return string_hash_make (if_rmap->ifname);
}
static int
@@ -212,7 +207,6 @@ DEFUN (if_rmap,
"Route map interface name\n")
{
enum if_rmap_type type;
- struct if_rmap *if_rmap;
if (strncmp (argv[1], "i", 1) == 0)
type = IF_RMAP_IN;
@@ -224,7 +218,7 @@ DEFUN (if_rmap,
return CMD_WARNING;
}
- if_rmap = if_rmap_set (argv[2], type, argv[0]);
+ if_rmap_set (argv[2], type, argv[0]);
return CMD_SUCCESS;
}