mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
packet/bgp: add error handling in flowSpecIpProtoParser()
Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
@@ -2210,6 +2210,9 @@ func flowSpecIpProtoParser(rf RouteFamily, args []string) (FlowSpecComponentInte
|
||||
protos := strings.Join(ss, "|")
|
||||
exp := regexp.MustCompile(fmt.Sprintf("^%s (((%s) )*)(%s)$", FlowSpecNameMap[FLOW_SPEC_TYPE_IP_PROTO], protos, protos))
|
||||
elems := exp.FindStringSubmatch(strings.Join(args, " "))
|
||||
if len(elems) < 2 {
|
||||
return nil, fmt.Errorf("invalid ip-proto format")
|
||||
}
|
||||
items := make([]*FlowSpecComponentItem, 0)
|
||||
eq := 0x1
|
||||
if elems[1] != "" {
|
||||
|
||||
Reference in New Issue
Block a user