From: Daniel Walton <[email protected]> Credit ------ A huge amount of credit for this patch goes to Piotr Chytla for their 'route tags support' patch that was submitted to quagga-dev in June 2007.
Documentation ------------- All ipv4 and ipv6 static route commands now have a "tag" option which allows the user to set a tag between 1 and 65535. quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag ? <1-65535> Tag value quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag 40 quagga(config)# quagga# show ip route 1.1.1.1/32 Routing entry for 1.1.1.1/32 Known via "static", distance 1, metric 0, tag 40, best * 10.1.1.1, via swp1 quagga# The route-map parser supports matching on tags and setting tags ! route-map MATCH_TAG_18 permit 10 match tag 18 ! ! route-map SET_TAG_22 permit 10 set tag 22 ! BGP and OSPF support: - matching on tags when redistribing routes from the RIB into BGP/OSPF. - setting tags when redistribing routes from the RIB into BGP/OSPF. BGP also supports setting a tag via a table-map, when installing BGP routes into the RIB. Signed-off-by: Daniel Walton <[email protected]> Signed-off-by: Piotr Chytla <[email protected]> Signed-off-by: Donald Sharp <[email protected]> --- ripd/rip_routemap.c | 23 ++++++++++++++++++----- ripngd/ripng_routemap.c | 8 ++++---- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c index 9bafdcd..cc0ed61 100644 --- a/ripd/rip_routemap.c +++ b/ripd/rip_routemap.c @@ -485,9 +485,22 @@ static void * route_match_tag_compile (const char *arg) { u_short *tag; + u_short tmp; + + /* tag value shoud be integer. */ + if (! all_digit (arg)) + return NULL; + + tmp = atoi(arg); + if (tmp < 1) + return NULL; tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short)); - *tag = atoi (arg); + + if (!tag) + return tag; + + *tag = tmp; return tag; } @@ -937,7 +950,7 @@ ALIAS (no_match_ip_address_prefix_list, DEFUN (match_tag, match_tag_cmd, - "match tag <0-65535>", + "match tag <1-65535>", MATCH_STR "Match tag of route\n" "Metric value\n") @@ -960,7 +973,7 @@ DEFUN (no_match_tag, ALIAS (no_match_tag, no_match_tag_val_cmd, - "no match tag <0-65535>", + "no match tag <1-65535>", NO_STR MATCH_STR "Match tag of route\n" @@ -1060,7 +1073,7 @@ ALIAS (no_set_ip_nexthop, DEFUN (set_tag, set_tag_cmd, - "set tag <0-65535>", + "set tag <1-65535>", SET_STR "Tag value for routing protocol\n" "Tag value\n") @@ -1083,7 +1096,7 @@ DEFUN (no_set_tag, ALIAS (no_set_tag, no_set_tag_val_cmd, - "no set tag <0-65535>", + "no set tag <1-65535>", NO_STR SET_STR "Tag value for routing protocol\n" diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c index f4fadb6..a316301 100644 --- a/ripngd/ripng_routemap.c +++ b/ripngd/ripng_routemap.c @@ -564,7 +564,7 @@ ALIAS (no_match_interface, DEFUN (match_tag, match_tag_cmd, - "match tag <0-65535>", + "match tag <1-65535>", MATCH_STR "Match tag of route\n" "Metric value\n") @@ -587,7 +587,7 @@ DEFUN (no_match_tag, ALIAS (no_match_tag, no_match_tag_val_cmd, - "no match tag <0-65535>", + "no match tag <1-65535>", NO_STR MATCH_STR "Match tag of route\n" @@ -675,7 +675,7 @@ ALIAS (no_set_ipv6_nexthop_local, DEFUN (set_tag, set_tag_cmd, - "set tag <0-65535>", + "set tag <1-65535>", SET_STR "Tag value for routing protocol\n" "Tag value\n") @@ -698,7 +698,7 @@ DEFUN (no_set_tag, ALIAS (no_set_tag, no_set_tag_val_cmd, - "no set tag <0-65535>", + "no set tag <1-65535>", NO_STR SET_STR "Tag value for routing protocol\n" -- 1.9.1 _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
