[packages] quagga: Drop heuristics for IPv6 address recognition
git-svn-id: svn://svn.openwrt.org/openwrt/packages@32698 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
3689198b21
commit
4fb0f4b557
92
net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch
Normal file
92
net/quagga/patches/007-drop-heuristic-ipv6-recognition.patch
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
Index: quagga-0.99.21/lib/command.c
|
||||||
|
===================================================================
|
||||||
|
--- quagga-0.99.21.orig/lib/command.c
|
||||||
|
+++ quagga-0.99.21/lib/command.c
|
||||||
|
@@ -868,86 +868,7 @@ cmd_ipv6_match (const char *str)
|
||||||
|
if (ret == 1)
|
||||||
|
return exact_match;
|
||||||
|
|
||||||
|
- while (*str != '\0')
|
||||||
|
- {
|
||||||
|
- switch (state)
|
||||||
|
- {
|
||||||
|
- case STATE_START:
|
||||||
|
- if (*str == ':')
|
||||||
|
- {
|
||||||
|
- if (*(str + 1) != ':' && *(str + 1) != '\0')
|
||||||
|
- return no_match;
|
||||||
|
- colons--;
|
||||||
|
- state = STATE_COLON;
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- sp = str;
|
||||||
|
- state = STATE_ADDR;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- continue;
|
||||||
|
- case STATE_COLON:
|
||||||
|
- colons++;
|
||||||
|
- if (*(str + 1) == ':')
|
||||||
|
- state = STATE_DOUBLE;
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- sp = str + 1;
|
||||||
|
- state = STATE_ADDR;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
- case STATE_DOUBLE:
|
||||||
|
- if (double_colon)
|
||||||
|
- return no_match;
|
||||||
|
-
|
||||||
|
- if (*(str + 1) == ':')
|
||||||
|
- return no_match;
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- if (*(str + 1) != '\0')
|
||||||
|
- colons++;
|
||||||
|
- sp = str + 1;
|
||||||
|
- state = STATE_ADDR;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- double_colon++;
|
||||||
|
- nums++;
|
||||||
|
- break;
|
||||||
|
- case STATE_ADDR:
|
||||||
|
- if (*(str + 1) == ':' || *(str + 1) == '\0')
|
||||||
|
- {
|
||||||
|
- if (str - sp > 3)
|
||||||
|
- return no_match;
|
||||||
|
-
|
||||||
|
- nums++;
|
||||||
|
- state = STATE_COLON;
|
||||||
|
- }
|
||||||
|
- if (*(str + 1) == '.')
|
||||||
|
- state = STATE_DOT;
|
||||||
|
- break;
|
||||||
|
- case STATE_DOT:
|
||||||
|
- state = STATE_ADDR;
|
||||||
|
- break;
|
||||||
|
- default:
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (nums > 8)
|
||||||
|
- return no_match;
|
||||||
|
-
|
||||||
|
- if (colons > 7)
|
||||||
|
- return no_match;
|
||||||
|
-
|
||||||
|
- str++;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-#if 0
|
||||||
|
- if (nums < 11)
|
||||||
|
- return partly_match;
|
||||||
|
-#endif /* 0 */
|
||||||
|
-
|
||||||
|
- return exact_match;
|
||||||
|
+ return no_match;
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum match_type
|
Loading…
x
Reference in New Issue
Block a user