Repository navigation
接口状态:PPP / tun 按 IFF_UP + carrier 判断(修正 #4) - #34
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4 按
IFF_UP|IFF_RUNNING判断 operstate=unknown 的接口,但 sysfs 的flags不包含易变标志IFF_RUNNING(内核只在 ioctl 里现算),在线的 PPP / tun 因此显示成 down。实测(路由器):
pppoe-wanoperstate=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