From e97594e0218584d766eaaa5822bb58bd26a7bb9d Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 25 Feb 2016 18:28:21 +0900 Subject: [PATCH] packet: fix strange flow spec fragment keywords "not-a-fragment" and "is-a-fragment" are renamed to "dont-fragment" and "is-fragment" respectively. Signed-off-by: FUJITA Tomonori --- docs/sources/flowspec.md | 2 +- gobgp/cmd/global.go | 2 +- packet/bgp.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/sources/flowspec.md b/docs/sources/flowspec.md index 055aab6b..6c64cbdc 100644 --- a/docs/sources/flowspec.md +++ b/docs/sources/flowspec.md @@ -40,7 +40,7 @@ CLI syntax to add flowspec is protocol ... | fragment | tcp-flags ... | { port | destination-port | source-port | icmp-type | icmp-code | packet-length | dscp } ... }... : ipip, sctp, unknown, igmp, tcp, egp, rsvp, pim, icmp, igp, udp, gre, ospf - : not-a-fragment, is-a-fragment, first-fragment, last-fragment + : dont-fragment, is-fragment, first-fragment, last-fragment : push, ack, urgent, fin, syn, rst : &?{<|>|=} : { accept | discard | rate-limit | redirect | mark | action { sample | terminal | sample-terminal } | rt ... }... diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index 8f257b4b..5d680e51 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -657,7 +657,7 @@ usage: %s rib %s match then -a %%s %s ... | %s | %s [not] [match] ... | { %s | %s | %s | %s | %s | %s | %s | %s } ... }... : %s - : not-a-fragment, is-a-fragment, first-fragment, last-fragment + : dont-fragment, is-fragment, first-fragment, last-fragment : %s : &?{<|>|=} : { %s | %s | %s | %s | %s | %s { sample | terminal | sample-terminal } | %s ... }... diff --git a/packet/bgp.go b/packet/bgp.go index 1b798ee1..4abc868d 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -2268,12 +2268,12 @@ func flowSpecFragmentParser(rf RouteFamily, args []string) (FlowSpecComponentInt value := 0 for _, a := range args[1:] { switch a { - case "not-a-fragment": + case "dont-fragment": if afi, _ := RouteFamilyToAfiSafi(rf); afi == AFI_IP6 { - return nil, fmt.Errorf("can't specify not-a-fragment for ipv6") + return nil, fmt.Errorf("can't specify dont-fragment for ipv6") } value |= 0x1 - case "is-a-fragment": + case "is-fragment": value |= 0x2 case "first-fragment": value |= 0x4 @@ -2630,10 +2630,10 @@ func formatFlag(op int, value int) string { func formatFragment(op int, value int) string { ss := make([]string, 0, 4) if value&0x1 > 0 { - ss = append(ss, "not-a-fragment") + ss = append(ss, "dont-fragment") } if value&0x2 > 0 { - ss = append(ss, "is-a-fragment") + ss = append(ss, "is-fragment") } if value&0x4 > 0 { ss = append(ss, "first-fragment")