]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix for route-maps with "match peer local" statements
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Fri, 13 Apr 2012 11:46:08 +0000 (13:46 +0200)
committerDavid Lamparter <equinox@diac24.net>
Wed, 2 May 2012 15:03:27 +0000 (17:03 +0200)
A route-map with a 'match peer local' statement it's shown like
'match peer (null)' on config output...

... and it's unparsable on daemon startup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd/bgp_routemap.c

index abb85fd219bdbed1de58c657212d0cba44db9647..f95cab130b5975b5840b916a44115de83c9258a0 100644 (file)
@@ -172,7 +172,7 @@ route_match_peer_compile (const char *arg)
 
   su = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (union sockunion));
 
-  ret = str2sockunion ( (arg)? arg : "0.0.0.0", su);
+  ret = str2sockunion (strcmp(arg, "local") ? arg : "0.0.0.0", su);
   if (ret < 0) {
     XFREE (MTYPE_ROUTE_MAP_COMPILED, su);
     return NULL;
@@ -2430,7 +2430,7 @@ DEFUN (match_peer_local,
         "Match peer address\n"
         "Static or Redistributed routes\n")
 {
-  return bgp_route_match_add (vty, vty->index, "peer", NULL);
+  return bgp_route_match_add (vty, vty->index, "peer", "local");
 }
 
 DEFUN (no_match_peer,