mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 13:56:45 -04:00
unix: use Go 1.21+ clear built-in
Inspired by CL 698495. Change-Id: Ic6ff68a60d41b6ffb6a28f523597c5d36c1e4d2f Reviewed-on: https://go-review.googlesource.com/c/sys/+/704915 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Mark Freeman <markfreeman@google.com>
This commit is contained in:
committed by
Tobias Klauser
parent
137f2eda35
commit
32e203842b
+1
-3
@@ -111,9 +111,7 @@ func (ifr *Ifreq) SetUint32(v uint32) {
|
||||
// clear zeroes the ifreq's union field to prevent trailing garbage data from
|
||||
// being sent to the kernel if an ifreq is reused.
|
||||
func (ifr *Ifreq) clear() {
|
||||
for i := range ifr.raw.Ifru {
|
||||
ifr.raw.Ifru[i] = 0
|
||||
}
|
||||
clear(ifr.raw.Ifru[:])
|
||||
}
|
||||
|
||||
// TODO(mdlayher): export as IfreqData? For now we can provide helpers such as
|
||||
|
||||
Reference in New Issue
Block a user