summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-25 18:28:21 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-25 18:28:21 +0900
commite97594e0218584d766eaaa5822bb58bd26a7bb9d (patch)
tree73c10da16d5e0dbed1cdca8841fff0799ecf0d4c
parent633e14d4d768766b6f74236415661f364778daa1 (diff)
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 <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--docs/sources/flowspec.md2
-rw-r--r--gobgp/cmd/global.go2
-rw-r--r--packet/bgp.go10
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 <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> : not-a-fragment, is-a-fragment, first-fragment, last-fragment
+ <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-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 8f257b4b..5d680e51 100644
--- a/gobgp/cmd/global.go
+++ b/gobgp/cmd/global.go
@@ -657,7 +657,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> : not-a-fragment, is-a-fragment, first-fragment, last-fragment
+ <FRAGMENT_TYPE> : dont-fragment, is-fragment, first-fragment, last-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 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")