summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaul <paul>2007-08-23 23:22:02 +0000
committerpaul <paul>2007-08-23 23:22:02 +0000
commitfad82c05a82b2460b5d3a8afe0e0e81fc33ebee5 (patch)
treeb8ebed3e37984532753ea07eb0baf202a23566b4
parentb9972dc924a4b81489d8cd51c13f7144608a2bc0 (diff)
downloadquagga-fad82c05a82b2460b5d3a8afe0e0e81fc33ebee5.tar.bz2
quagga-fad82c05a82b2460b5d3a8afe0e0e81fc33ebee5.tar.xz
[bgpd] Pass NOSUB to regexec
2007-08-23 Paul Jakma <paul.jakma@sun.com> * bgp_regex.c: (bgp_regcomp) Pass NOSUB flag to regcomp to prevent parsing of substitutions, which can have profound performance effects on bgpd and are of no use to the CLI anyway. How much it helps depends on the regex implementation.
-rw-r--r--bgpd/ChangeLog8
-rw-r--r--bgpd/bgp_regex.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 26614ced..548fd4d6 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-23 Paul Jakma <paul.jakma@sun.com>
+
+ * bgp_regex.c: (bgp_regcomp) Pass NOSUB flag to regcomp to
+ prevent parsing of substitutions, which can have profound
+ performance effects on bgpd and are of no use to the CLI
+ anyway. How much it helps depends on the regex
+ implementation.
+
2007-07-31 Paul Jakma <paul.jakma@sun.com>
* (general) Support for draft-ietf-idr-as-pathlimit-03.
diff --git a/bgpd/bgp_regex.c b/bgpd/bgp_regex.c
index be84d407..9b65f7cb 100644
--- a/bgpd/bgp_regex.c
+++ b/bgpd/bgp_regex.c
@@ -66,7 +66,7 @@ bgp_regcomp (const char *regstr)
regex = XMALLOC (MTYPE_BGP_REGEXP, sizeof (regex_t));
- ret = regcomp (regex, magic_str, REG_EXTENDED);
+ ret = regcomp (regex, magic_str, REG_EXTENDED|REG_NOSUB);
XFREE (MTYPE_TMP, magic_str);