Skip to content

Commit

Permalink
Ignore EOPNOTSUPP for SIOCGHWTSTAMP (#343)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #343

Some hardware doesn't have non-distructive SIOCGHWTSTAMP but can still do hardware timestamping. It's mostly about HW having ext PHY module. Let's ignore this error and allow setting values

Reviewed By: leoleovich

Differential Revision: D56185343

fbshipit-source-id: e906af27db7e3e0eb0e1b08df41dbc19490bad98
  • Loading branch information
vvfedorenko authored and facebook-github-bot committed Apr 16, 2024
1 parent 83a4294 commit e712c75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion timestamp/timestamp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func ioctlTimestamp(fd int, ifname string, filter int32) error {

i := &ifreq{data: uintptr(unsafe.Pointer(hw))}
copy(i.name[:unix.IFNAMSIZ-1], ifname)
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), unix.SIOCGHWTSTAMP, uintptr(unsafe.Pointer(i))); errno != 0 {
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), unix.SIOCGHWTSTAMP, uintptr(unsafe.Pointer(i))); errno != 0 && errno != unix.ENOTSUP {
return fmt.Errorf("failed to run ioctl SIOCGHWTSTAMP to see what is enabled: %s (%w)", unix.ErrnoName(errno), errno)
}

Expand Down

0 comments on commit e712c75

Please sign in to comment.