Содержимое пина, зафиксированного в go.mod sing-box-lx, одним коммитом без истории. Полная история SagerNet/gvisor — 1.45 ГБ и клонируется в каждой CI-джобе; наша дельта — одна вставка в одну функцию, история для неё не нужна. Module path github.com/sagernet/gvisor сохранён намеренно: на него опирается replace-директива суперпроекта. Патч поверх — отдельным коммитом, чтобы дельта читалась одним git show и переносилась на новый пин копированием. SPECS/TASKS/048-GVISOR_HANDSHAKE_NIL_CRASH
56 lines
1.2 KiB
Go
56 lines
1.2 KiB
Go
// automatically generated by stateify.
|
|
|
|
//go:build linux
|
|
// +build linux
|
|
|
|
package xdp
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sagernet/gvisor/pkg/state"
|
|
)
|
|
|
|
func (ep *endpoint) StateTypeName() string {
|
|
return "pkg/tcpip/link/xdp.endpoint"
|
|
}
|
|
|
|
func (ep *endpoint) StateFields() []string {
|
|
return []string{
|
|
"fd",
|
|
"caps",
|
|
"networkDispatcher",
|
|
"control",
|
|
"stopFD",
|
|
"addr",
|
|
}
|
|
}
|
|
|
|
func (ep *endpoint) beforeSave() {}
|
|
|
|
// +checklocksignore
|
|
func (ep *endpoint) StateSave(stateSinkObject state.Sink) {
|
|
ep.beforeSave()
|
|
stateSinkObject.Save(0, &ep.fd)
|
|
stateSinkObject.Save(1, &ep.caps)
|
|
stateSinkObject.Save(2, &ep.networkDispatcher)
|
|
stateSinkObject.Save(3, &ep.control)
|
|
stateSinkObject.Save(4, &ep.stopFD)
|
|
stateSinkObject.Save(5, &ep.addr)
|
|
}
|
|
|
|
func (ep *endpoint) afterLoad(context.Context) {}
|
|
|
|
// +checklocksignore
|
|
func (ep *endpoint) StateLoad(ctx context.Context, stateSourceObject state.Source) {
|
|
stateSourceObject.Load(0, &ep.fd)
|
|
stateSourceObject.Load(1, &ep.caps)
|
|
stateSourceObject.Load(2, &ep.networkDispatcher)
|
|
stateSourceObject.Load(3, &ep.control)
|
|
stateSourceObject.Load(4, &ep.stopFD)
|
|
stateSourceObject.Load(5, &ep.addr)
|
|
}
|
|
|
|
func init() {
|
|
state.Register((*endpoint)(nil))
|
|
}
|