From 7c364cc1000639c5bbc3258ece55a9f613adc5b3 Mon Sep 17 00:00:00 2001 From: Apoorva Bhagwat Date: Wed, 20 Aug 2025 15:59:37 +0000 Subject: [PATCH 1/2] Fix stringification code for `headerType` (under `pkg/tcpip/stack`). This was changed [when a new headertype (virtionetheader) was added](https://github.com/google/gvisor/commit/c06c9deb1c71f235f646c4dc644e848df748c2da#diff-18df233b2766aad71cf642c99506a0f1b3001e1cff462e57d0deb7c4839301c8, but the `_headerType_index` array wasn't updated correctly. I've fixed this by re-running stringer: ``` cd pkg/tcpip/stack go run golang.org/x/tools/cmd/stringer -type headerType . ``` --- pkg/tcpip/stack/headertype_string.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/tcpip/stack/headertype_string.go b/pkg/tcpip/stack/headertype_string.go index cd80de0cd3..02ce9b37b8 100644 --- a/pkg/tcpip/stack/headertype_string.go +++ b/pkg/tcpip/stack/headertype_string.go @@ -1,16 +1,3 @@ -// Copyright 2020 The gVisor Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - // Code generated by "stringer -type headerType ."; DO NOT EDIT. package stack @@ -30,7 +17,7 @@ func _() { const _headerType_name = "virtioNetHeaderlinkHeadernetworkHeadertransportHeadernumHeaderType" -var _headerType_index = [...]uint8{0, 10, 23, 38, 51} +var _headerType_index = [...]uint8{0, 15, 25, 38, 53, 66} func (i headerType) String() string { if i < 0 || i >= headerType(len(_headerType_index)-1) { From 88a33a93bfc8e5ee66457c0dee044091ab285345 Mon Sep 17 00:00:00 2001 From: Apoorva Bhagwat Date: Wed, 20 Aug 2025 19:40:53 +0000 Subject: [PATCH 2/2] Add the copyright message back. --- pkg/tcpip/stack/headertype_string.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/tcpip/stack/headertype_string.go b/pkg/tcpip/stack/headertype_string.go index 02ce9b37b8..bc320a414d 100644 --- a/pkg/tcpip/stack/headertype_string.go +++ b/pkg/tcpip/stack/headertype_string.go @@ -1,3 +1,16 @@ +// Copyright 2020 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by "stringer -type headerType ."; DO NOT EDIT. package stack