equal
deleted
inserted
replaced
1 commit 6d134fb4defecb16591adbf4acb020acd165a75a |
|
2 Author: Paul Jakma <[email protected]> |
|
3 Date: Thu Aug 23 23:22:02 2007 +0000 |
|
4 |
|
5 [bgpd] Pass NOSUB to regexec |
|
6 |
|
7 2007-08-23 Paul Jakma <[email protected]> |
|
8 |
|
9 * bgp_regex.c: (bgp_regcomp) Pass NOSUB flag to regcomp to |
|
10 prevent parsing of substitutions, which can have profound |
|
11 performance effects on bgpd and are of no use to the CLI |
|
12 anyway. How much it helps depends on the regex |
|
13 implementation. |
|
14 |
|
15 diff --git a/bgpd/bgp_regex.c b/bgpd/bgp_regex.c |
|
16 index be84d40..9b65f7c 100644 |
|
17 --- bgpd/bgp_regex.c |
|
18 +++ bgpd/bgp_regex.c |
|
19 @@ -66,7 +66,7 @@ bgp_regcomp (const char *regstr) |
|
20 |
|
21 regex = XMALLOC (MTYPE_BGP_REGEXP, sizeof (regex_t)); |
|
22 |
|
23 - ret = regcomp (regex, magic_str, REG_EXTENDED); |
|
24 + ret = regcomp (regex, magic_str, REG_EXTENDED|REG_NOSUB); |
|
25 |
|
26 XFREE (MTYPE_TMP, magic_str); |
|
27 |
|