Skip to content

Conversation

@abhagwat
Copy link
Contributor

This was changed when a new headertype (virtionetheader) was added, 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 .

I found this when I was debugging a crash during memory-snapshot restoration. The error message says: panic: consume must not be called twice: type ernetworkHeader:

panic(fmt.Sprintf("consume must not be called twice: type %s", typ))

This was changed [when a new headertype (virtionetheader) was added](google@c06c9de#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 .
```
@google-cla
Copy link

google-cla bot commented Aug 20, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ayushr2
Copy link
Collaborator

ayushr2 commented Aug 20, 2025

Could you also sign the CLA

Copy link
Collaborator

@ayushr2 ayushr2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

copybara-service bot pushed a commit that referenced this pull request Aug 20, 2025
This was changed [when a new headertype (virtionetheader) was added](c06c9de#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 .
```

---

I found this when I was debugging a crash during memory-snapshot restoration. The error message says: `panic: consume must not be called twice: type ernetworkHeader`: https://github.com/google/gvisor/blob/c07c524742a7033ff4e8e8d7de9cf48929e1e484/pkg/tcpip/stack/packet_buffer.go#L347

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12064 from abhagwat:apoorva/fix-stringification-for-headertype 88a33a9
PiperOrigin-RevId: 797469761
copybara-service bot pushed a commit that referenced this pull request Aug 20, 2025
This was changed [when a new headertype (virtionetheader) was added](c06c9de#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 .
```

---

I found this when I was debugging a crash during memory-snapshot restoration. The error message says: `panic: consume must not be called twice: type ernetworkHeader`: https://github.com/google/gvisor/blob/c07c524742a7033ff4e8e8d7de9cf48929e1e484/pkg/tcpip/stack/packet_buffer.go#L347

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12064 from abhagwat:apoorva/fix-stringification-for-headertype 88a33a9
PiperOrigin-RevId: 797469761
@copybara-service copybara-service bot merged commit db0e3ac into google:master Aug 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants