diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-11-20 08:57:42 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-11-24 12:55:34 +0900 |
commit | 8e98018c75db0d5cadb9f12d4e8f2cf24ad59e08 (patch) | |
tree | 4c94b4171eba89fa4dbe0ea0eda72f700b5f7fd3 /packet | |
parent | 8fd741dea151f18f1a5fdb00e830489f459105c3 (diff) |
packet/bgp: Invert FlowSpec bitmask operand position
Currently, if the both NOT and MATCH bit are set for the FlowSpec
bitmask operand, the string representation will be "=!".
For the readability and the consistency with the representation of
numeric operator, it should be "!=".
This patch inverts "=!" into "!=" for the bitmask operand.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet')
-rw-r--r-- | packet/bgp/bgp.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 8c4400ba..bf90cfc6 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -3772,12 +3772,12 @@ func formatProto(op int, value int) string { func formatTCPFlag(op int, value int) string { var retString string - if op&BITMASK_FLAG_OP_MATCH > 0 { - retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]) - } if op&BITMASK_FLAG_OP_NOT > 0 { retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_NOT]) } + if op&BITMASK_FLAG_OP_MATCH > 0 { + retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]) + } // Prepare a sorted list of flags because map iterations does not happen // in a consistent order in Golang. @@ -3802,12 +3802,12 @@ func formatTCPFlag(op int, value int) string { func formatFragment(op int, value int) string { var retString string - if op&BITMASK_FLAG_OP_MATCH > 0 { - retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]) - } if op&BITMASK_FLAG_OP_NOT > 0 { retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_NOT]) } + if op&BITMASK_FLAG_OP_MATCH > 0 { + retString = fmt.Sprintf("%s%s", retString, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]) + } // Prepare a sorted list of flags because map iterations does not happen // in a consistent order in Golang. |