diff options
-rw-r--r-- | docs/sources/flowspec.md | 2 | ||||
-rw-r--r-- | gobgp/cmd/global.go | 2 | ||||
-rw-r--r-- | packet/bgp.go | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/docs/sources/flowspec.md b/docs/sources/flowspec.md index 6c64cbdc..97ab2a85 100644 --- a/docs/sources/flowspec.md +++ b/docs/sources/flowspec.md @@ -40,7 +40,7 @@ CLI syntax to add flowspec is protocol <PROTO>... | fragment <FRAGMENT_TYPE> | tcp-flags <TCPFLAG>... | { port | destination-port | source-port | icmp-type | icmp-code | packet-length | dscp } <ITEM>... }... <PROTO> : ipip, sctp, unknown, igmp, tcp, egp, rsvp, pim, icmp, igp, udp, gre, ospf - <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment + <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment, not-a-fragment <TCPFLAG> : push, ack, urgent, fin, syn, rst <ITEM> : &?{<|>|=}<value> <THEN_EXPR> : { accept | discard | rate-limit <value> | redirect <RT> | mark <value> | action { sample | terminal | sample-terminal } | rt <RT>... }... diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index 1b1ca8ed..0ad6a860 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -721,7 +721,7 @@ usage: %s rib %s match <MATCH_EXPR> then <THEN_EXPR> -a %%s %s <PROTO>... | %s <FRAGMENT_TYPE> | %s [not] [match] <TCPFLAG>... | { %s | %s | %s | %s | %s | %s | %s | %s } <ITEM>... }... <PROTO> : %s - <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment + <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-fragment, not-a-fragment <TCPFLAG> : %s <ITEM> : &?{<|>|=}<value> <THEN_EXPR> : { %s | %s | %s <value> | %s <RT> | %s <value> | %s { sample | terminal | sample-terminal } | %s <RT>... }... diff --git a/packet/bgp.go b/packet/bgp.go index 32ef2d32..1f0ee166 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -2309,6 +2309,8 @@ func flowSpecFragmentParser(rf RouteFamily, args []string) (FlowSpecComponentInt value = 0x4 case "last-fragment": value = 0x8 + case "not-a-fragment": + value = 0x0 default: return nil, fmt.Errorf("invalid flowspec fragment specifier") } @@ -2676,7 +2678,10 @@ func formatFlag(op int, value int) string { } func formatFragment(op int, value int) string { - ss := make([]string, 0, 4) + ss := make([]string, 0) + if value == 0 { + ss = append(ss, "not-a-fragment") + } if value&0x1 > 0 { ss = append(ss, "dont-fragment") } |