build(deps): bump github.com/cilium/ebpf from 0.12.1 to 0.12.2

Bumps [github.com/cilium/ebpf](https://github.com/cilium/ebpf) from 0.12.1 to 0.12.2.
- [Release notes](https://github.com/cilium/ebpf/releases)
- [Commits](https://github.com/cilium/ebpf/compare/v0.12.1...v0.12.2)

---
updated-dependencies:
- dependency-name: github.com/cilium/ebpf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-10-23 04:08:30 +00:00
committed by GitHub
parent cf4c7c902b
commit d60d17a6ec
7 changed files with 23 additions and 12 deletions
+16 -1
View File
@@ -11,6 +11,8 @@ import (
"unsafe"
"github.com/cilium/ebpf/internal"
"golang.org/x/exp/slices"
)
// Marshal turns data into a byte slice using the system's native endianness.
@@ -88,6 +90,11 @@ func Unmarshal(data interface{}, buf []byte) error {
*value = string(buf)
return nil
case *[]byte:
// Backwards compat: unmarshaling into a slice replaces the whole slice.
*value = slices.Clone(buf)
return nil
default:
if dataBuf := unsafeBackingMemory(data); len(dataBuf) == len(buf) {
copy(dataBuf, buf)
@@ -99,7 +106,15 @@ func Unmarshal(data interface{}, buf []byte) error {
rd.Reset(buf)
return binary.Read(rd, internal.NativeEndian, value)
if err := binary.Read(rd, internal.NativeEndian, value); err != nil {
return err
}
if rd.Len() != 0 {
return fmt.Errorf("unmarshaling %T doesn't consume all data", data)
}
return nil
}
}
+1 -5
View File
@@ -1411,11 +1411,7 @@ func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool {
return false
}
// The user can get access to nextKey since unmarshalBytes
// does not copy when unmarshaling into a []byte.
// Make a copy to prevent accidental corruption of
// iterator state.
copy(mi.curKey, nextKey)
mi.curKey = nextKey
mi.count++
mi.err = mi.target.Lookup(nextKey, valueOut)
+1 -1
View File
@@ -219,7 +219,7 @@ const (
type AttachFlags uint32
// PinType determines whether a map is pinned into a BPFFS.
type PinType int
type PinType uint32
// Valid pin types.
//
+1 -1
View File
@@ -111,7 +111,7 @@ const _PinType_name = "PinNonePinByName"
var _PinType_index = [...]uint8{0, 7, 16}
func (i PinType) String() string {
if i < 0 || i >= PinType(len(_PinType_index)-1) {
if i >= PinType(len(_PinType_index)-1) {
return "PinType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _PinType_name[_PinType_index[i]:_PinType_index[i+1]]