raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SO_TIMESTAMPNS Support is absent in the kernal?

SpiderUnderUrBed opened this issue · comments

Describe the bug

I was wondering whether or not this is the right place for this, but this does seem like a bug as a kernal level feature just seemed to break? I posted questions on reddit and the forum about this issue. However I think that posting there maybe was a mistake, anyways here is the issue:
SO_TIMESTAMPNS is non-existent in the kernal or had been disabled due to some bug, there is no indication on my system that this feature exists now and maybe i need a kernal patch or this is a issue with the kernal itself, recently unbound hasnt been working and so has things like nload, the wifi monitoring tool, it graphs your wifi usage from certain interfaces and around the same time SO_TIMESTAMPNS stopped working its graphing feature stopped working:


[1710322190] unbound[1:0] error: setsockopt(..., SOTIMESTAMPNS, ...) failed: Protocol not available

[1710322190] unbound[1:0] warning: socket timestamping is not available

[1710322190] unbound[1:0] error: setsockopt(..., SO_TIMESTAMPNS, ...) failed: Protocol not available

[1710322190] unbound[1:0] warning: socket timestamping is not available

[1710322190] unbound[1:0] error: setsockopt(..., SO_TIMESTAMPNS, ...) failed: Protocol not available

[1710322190] unbound[1:0] warning: socket timestamping is not available


Dmesg (the log is uneventful):
https://pastebin.com/4ibdq4i9

While I have unbound and alot of my services in docker-compose, sending the docker compose file is probably irrelevent to this bug

Steps to reproduce the behaviour

I dont know what kernal version this bug affects, I am on kernal version 6.1.0-rpi8-rpi-v8, my OS is Debian GNU/Linux 12 (bookworm) aarch64

While the unbound issue is new you can test SO_TIMESTAMPNS support by trying to run this in python or the equivalent in C
import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_TIMESTAMPNS, 1)
This should return the error about SO_TIMESTAMPNS

Device (s)

Raspberry Pi 4 Mod. B

System

Raspberry Pi reference 2023-12-05
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 70cd6f2a1e34d07f5cba7047aea5b92457372e05, stage4

Oct 17 2023 15:39:16
Copyright (c) 2012 Broadcom
version 30f0c5e4d076da3ab4f341d88e7d505760b93ad7 (clean) (release) (start)

Linux raspberrypi 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

Logs

Dmesg (the log is uneventful):
https://pastebin.com/4ibdq4i9

Additional context

My issue on the forums: https://forums.raspberrypi.com/viewtopic.php?t=367351

This is entirely not a linux kernel issue, on my Windows machine I get the same issue...

I guess this has been deprecated or it probably never existed...

I've noticed there are multiple threads on StackOverflow about it and around the net.

The solution I've noticed running is this one:

import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
SO_TIMESTAMPNS = 35

try:
    sock.setsockopt(socket.SOL_SOCKET, SO_TIMESTAMPNS, 1)
except socket.error as e:
    print("Error:", e)

(Not sure if it works by any means but it gives no execution error, also seen here)