From 5f39f4c04f73ae670b655f23f30a8c74eb91896d Mon Sep 17 00:00:00 2001 From: 0x67cq <0x67cq@gmail.com> Date: Wed, 5 Jan 2022 14:55:55 +0800 Subject: [PATCH] fix: the regular expression of quagga BGP neighbor state check does not match year unit --- quagga/bgp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quagga/bgp.go b/quagga/bgp.go index 2d5b708..fefd4eb 100644 --- a/quagga/bgp.go +++ b/quagga/bgp.go @@ -236,7 +236,7 @@ func (b *BGP) Withdraw(n *net.IPNet) error { var ( neighborRE = regexp.MustCompile(`^BGP neighbor is ([a-f0-9.:]+), remote AS (\d+), local AS (\d+),.*$`) neighborDescRE = regexp.MustCompile(`^ Description: (.*)$`) - neighborStateRE = regexp.MustCompile(`^ BGP state = (\w+)(, up for ([0-9wdhm:]+))?$`) + neighborStateRE = regexp.MustCompile(`^ BGP state = (\w+)(, up for ([0-9ywdhm:]+))?$`) neighborStatsRE = regexp.MustCompile(`^ (\w+): +(\d+) +(\d+)$`) neighborVersionRE = regexp.MustCompile(`^ BGP version (\d), remote router ID ([a-f0-9.:]+)`) )