diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-07-01 01:38:21 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-01 01:38:21 +0000 |
commit | 28291a5a5d25633c8bdf45ed5affe90f779c74b4 (patch) | |
tree | 1d70f35b00068a83e568d84a00c8555dbb27edb5 /pkg | |
parent | e75120d9b11f25bf12cf999efb0bd738eb82c662 (diff) | |
parent | 07ffecef83bd31e78786af901c49a7be93b20517 (diff) |
Merge release-20210628.0-15-g07ffecef8 (automated)
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/tcpip/header/ndp_router_advert.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/tcpip/header/ndp_router_advert.go b/pkg/tcpip/header/ndp_router_advert.go index 7e2f0c797..7d6efa083 100644 --- a/pkg/tcpip/header/ndp_router_advert.go +++ b/pkg/tcpip/header/ndp_router_advert.go @@ -16,9 +16,12 @@ package header import ( "encoding/binary" + "fmt" "time" ) +var _ fmt.Stringer = NDPRoutePreference(0) + // NDPRoutePreference is the preference values for default routers or // more-specific routes. // @@ -64,6 +67,22 @@ const ( ReservedRoutePreference = 0b10 ) +// String implements fmt.Stringer. +func (p NDPRoutePreference) String() string { + switch p { + case HighRoutePreference: + return "HighRoutePreference" + case MediumRoutePreference: + return "MediumRoutePreference" + case LowRoutePreference: + return "LowRoutePreference" + case ReservedRoutePreference: + return "ReservedRoutePreference" + default: + return fmt.Sprintf("NDPRoutePreference(%d)", p) + } +} + // NDPRouterAdvert is an NDP Router Advertisement message. It will only contain // the body of an ICMPv6 packet. // |