luci-mod-network: use device-specific MTU limits - #8915
Conversation
19d4e3c to
7d5612b
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
7d5612b"luci-mod-network: use device-specific MTU limits" — the subject scopes the change toluci-mod-network, but the commit also toucheslibs/rpcd-mod-luci/src/luci.c(new sysfs reads in the rpcd C plugin) andmodules/luci-base/htdocs/luci-static/resources/network.js(newDevice.getMinMTU()/getMaxMTU()API).CONTRIBUTING.mdasks for a subject prefixed with the affected component, and this tree normally splits per-package changes into separate commits — here that would be three: onerpcd-mod-luci:(backend attributes + version bump), oneluci-base:(model accessors), oneluci-mod-network:(form validation). Splitting also makes the cross-repo/package dependency explicit, which matters because the frontend silently degrades to the old fallback range when the backend half is not installed.
Generated by Claude Code
7d5612b to
f7c2426
Compare
|
Addressed the review: split the backend, model and form changes into three package-scoped commits; bumped rpcd-mod-luci; synchronized the displayed and validated ranges; and applied the device-specific ceiling to IPv6 MTU. The branch was force-pushed and the PR description was updated. |
219a400 to
49af795
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
b50f6e0"rpcd-mod-luci: expose device MTU limits" — the message says "Linux exposes the supported MTU range throughmin_mtuandmax_mtusysfs attributes", but the diff does not read sysfs: it opens aNETLINK_ROUTEsocket and parsesIFLA_MIN_MTU/IFLA_MAX_MTUfrom anRTM_GETLINKreply. There are nomin_mtu/max_mtufiles under/sys/class/net/<dev>/(the kernel only exposesmtuthere), which is presumably why the implementation moved to rtnetlink between revisions — but the commit message still describes the earlier sysfs approach. The PR body already says "read from rtnetlink"; the commit message should match.
The per-package split requested on the previous revision is done correctly — all three commit subjects match the files they touch.
Generated by Claude Code
49af795 to
3ae81b1
Compare
|
Fixed in the current head. Commit |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 3 new commits (force-push over 49af795); no commit-message issues — the sysfs wording flagged last round is gone and each subject matches the files it touches.
The rtnetlink rework looks right: one RTM_GETLINK | NLM_F_DUMP per getNetworkDevices, the same nl_cb_alloc/nl_cb_set/nl_cb_err + pending shape as the existing rpc_luci_get_host_hints_nl(), and the limit list is freed on every path. Two nits inline.
Generated by Claude Code
3ae81b1 to
8674732
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 3 new commits (force-push over 3ae81b1). The only code change since the last revision is the sub-576 branch in tools/network.js, and it holds up: I exercised the new expression over the interesting (min_mtu, max_mtu) pairs — (68,1500)→range(576,1500), (128,300)→range(128,300), (0,300)→range(300,300), (400,300)→range(300,300), (null,null)→range(576,9200) — and every result is satisfiable with the kernel minimum preferred over the ceiling on low-MTU devices, which was the point. The three continuation-line re-indents in luci.c match the space-aligned style of the surrounding signatures. FormalityCheck is green on 8674732.
Commit checks
8674732"luci-mod-network: use device-specific MTU limits" — the commit also toucheslibs/rpcd-mod-luci/src/luci.c(the three continuation-line re-indents at lines 705, 761 and 774), which is outside theluci-mod-network:subject scope and re-formats whitespace that135e2e1introduced earlier in the same series. Squashing those three hunks into135e2e1keeps each commit inside its own package — the split you did on the previous revision — and removes an introduce-then-fix pair from the series.135e2e1and07836c5match the files they touch.
Generated by Claude Code
Query RTM_GETLINK once and include the kernel-reported minimum and maximum MTU values in getNetworkDevices. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Add accessors for the minimum and maximum MTU values returned by getNetworkDevices. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Validate MTU against the kernel-reported range for each network device. Keep 576 to 9200 as the fallback and constrain IPv6 MTU only on devices capable of carrying it. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
8674732 to
8ed21a4
Compare
|
Good point. I moved the three The aggregate tree is byte-identical to the previously green |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 3 new commits (force-push over 8674732); no new issues found.
I confirmed the rebase claim locally: git diff 8674732947..8ed21a4afc is empty, so the tree is unchanged and only commit ownership moved. The commit-check nit from the last round is resolved — f6eaaae now carries all of libs/rpcd-mod-luci/ (Makefile bump + luci.c, including the three continuation-line re-indents), ac41ffc only luci-base's network.js, and 8ed21a4 only luci-mod-network's tools/network.js. Each subject matches its files, and the introduce-then-fix pair is gone. All three FormalityCheck runs are green on 8ed21a4.
Generated by Claude Code
Description
Use the per-device
min_mtuandmax_mtuvalues exposed by Linux instead of validating every network device against the hardcoded 576 to 9200 range.The values are collected with one rtnetlink link dump per
getNetworkDevicescall, returned by
luci-rpc, preserved in the shared network device model, andused for form validation. Devices or kernels which do not expose the attributes
keep the existing fallback limits. The kernel maximum is also applied to the
IPv6 MTU field. The field is omitted on link-layer devices which cannot carry
IPv6's 1280-byte minimum.
The general MTU field retains the previous safe 576-byte floor when the kernel
reports a lower link-layer minimum.
The backend, model and form changes are split into their respective package
commits. The
rpcd-mod-luciversion is bumped so existing installations pullthe updated RPC module.
Testing
git diff --checkrpcd-mod-luciforramips/mt7620(mipsel_24kc)