x/net/ipv6: split Set method of ICMPFilter into Accept, Block methods
This is an API breaking change.
method (*ICMPFilter) Set(ICMPType, bool)
is now replaced with
method (*ICMPFilter) Accept(ICMPType)
method (*ICMPFilter) Block(ICMPType)
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/182450043
diff --git a/ipv6/icmp_bsd.go b/ipv6/icmp_bsd.go
index f6f7d78..30e3ce4 100644
--- a/ipv6/icmp_bsd.go
+++ b/ipv6/icmp_bsd.go
@@ -6,12 +6,12 @@
package ipv6
-func (f *sysICMPv6Filter) set(typ ICMPType, block bool) {
- if block {
- f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)
- } else {
- f.Filt[typ>>5] |= 1 << (uint32(typ) & 31)
- }
+func (f *sysICMPv6Filter) accept(typ ICMPType) {
+ f.Filt[typ>>5] |= 1 << (uint32(typ) & 31)
+}
+
+func (f *sysICMPv6Filter) block(typ ICMPType) {
+ f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)
}
func (f *sysICMPv6Filter) setAll(block bool) {