diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-07 21:09:10 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-07 21:09:10 +0000 |
commit | e73679d58c108590c22a2ec269cd2d7e9aff50dd (patch) | |
tree | 1da5000a87e4a31ce17fd9f1af2a196df1fced12 /pkg/sentry/socket/socket_state.go | |
parent | d3d3a0f6cd35fd3f7175667d4babc3a81cb27177 (diff) | |
parent | a7045f051f7bcdca079cdb0636f728a18b609121 (diff) |
Merge release-20210927.0-44-ga7045f051 (automated)
Diffstat (limited to 'pkg/sentry/socket/socket_state.go')
-rw-r--r-- | pkg/sentry/socket/socket_state.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkg/sentry/socket/socket_state.go b/pkg/sentry/socket/socket_state.go new file mode 100644 index 000000000..32e12b238 --- /dev/null +++ b/pkg/sentry/socket/socket_state.go @@ -0,0 +1,27 @@ +// Copyright 2021 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. + +package socket + +import ( + "time" +) + +func (i *IPControlMessages) saveTimestamp() int64 { + return i.Timestamp.UnixNano() +} + +func (i *IPControlMessages) loadTimestamp(nsec int64) { + i.Timestamp = time.Unix(0, nsec) +} |