Skip to content

接口状态:PPP / tun 按 IFF_UP + carrier 判断(修正 #4) - #34

Merged
Cd1s merged 1 commit into
mainfrom
fix/oper-carrier
Sep 25, 2026
Merged

Cd1s merged 1 commit into
mainfrom
fix/oper-carrier

Conversation

@Cd1s

@Cd1s Cd1s commented Sep 25, 2026

Copy link
Copy Markdown
Owner

#4 按 IFF_UP|IFF_RUNNING 判断 operstate=unknown 的接口,但 sysfs 的 flags 不包含易变标志 IFF_RUNNING(内核只在 ioctl 里现算),在线的 PPP / tun 因此显示成 down。

实测(路由器):pppoe-wan operstate=unknown、flags=0x1091、carrier=1;tailscale0 同样。

改为:operstate 为 unknown 时,IFF_UP 且 carrier=1 → up,否则 down。测试用例改用实测值。已在路由器上热部署验证:两条 PPPoE、tailscale0 显示 up,未插线的 lan4 为 lowerlayerdown。

Fixes #1

https://claude.ai/code/session_01JNYstNakN2UFKH2oML3SbM

sysfs flags never carry the volatile IFF_RUNNING, so the previous fix showed online PPP / tun interfaces as
down. Measured on a router: pppoe-wan operstate=unknown flags=0x1091 carrier=1; the tests use those values.

Fixes #1

Claude-Session: https://claude.ai/code/session_01JNYstNakN2UFKH2oML3SbM
@Cd1s Cd1s added bug Something isn't working area:net 模块:net area:mon 模块:mon labels Sep 25, 2026
@Cd1s
Cd1s merged commit 6641359 into main Sep 25, 2026
2 checks passed
@Cd1s
Cd1s deleted the fix/oper-carrier branch September 25, 2026 13:44
@Cd1s Cd1s mentioned this pull request Sep 25, 2026
52 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:mon 模块:mon area:net 模块:net bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

接口状态:PPPoE / tailscale 等接口显示 unknown

1 participant