Skip to content

[fix] Added support for PPPoE management interfaces#259

Merged
nemesifier merged 2 commits into
openwisp:masterfrom
tizbac:tizbac-patch-pppoe
May 29, 2026
Merged

[fix] Added support for PPPoE management interfaces#259
nemesifier merged 2 commits into
openwisp:masterfrom
tizbac:tizbac-patch-pppoe

Conversation

@tizbac

@tizbac tizbac commented May 29, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #258

Description of Changes

The interface protocol is checked for it being pppoe if true since openwrt names the actual interface returned by nixio to pppoe-xxx , pppoe- is prepended like done for the bridge case

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 99959927-f362-485b-bb53-26067ee56f76

📥 Commits

Reviewing files that changed from the base of the PR and between a8ae8d8 and 95870e5.

📒 Files selected for processing (2)
  • openwisp-config/tests/test_net.lua
  • runtests
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: QA-Checks and Tests
🔇 Additional comments (4)
openwisp-config/tests/test_net.lua (3)

1-28: LGTM!


30-37: LGTM!


39-48: LGTM!

runtests (1)

12-12: LGTM!


📝 Walkthrough

Walkthrough

This PR extends openwisp.net.get_interface to detect when a UCI network section's proto is "pppoe" and construct the interface name as "pppoe-" (mirroring existing bridge "br-" handling). It adds LuaUnit tests that stub UCI and nixio to verify bridge and PPPoE name resolution and updates the runtests script to run the new test file.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant net.get_interface
  participant UCI
  participant nixio
  Caller->>net.get_interface: get_interface("<name>")
  net.get_interface->>UCI: cursor(): get("network", "<name>", "proto")
  alt proto == "pppoe"
    net.get_interface->>nixio: interfaces(): find name "pppoe-<name>"
  else proto == "bridge"
    net.get_interface->>nixio: interfaces(): find name "br-<name>"
  else
    net.get_interface->>nixio: interfaces(): find name "<name>"
  end
  nixio-->>net.get_interface: interface object / nil
  net.get_interface-->>Caller: interface or nil
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the core functionality change but is missing test cases and documentation updates as noted in the unchecked checklist items. Check the test case checkbox if test_net.lua tests are intended to satisfy this requirement, and clarify whether documentation updates are needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is fully related to the main change, using the required format [fix] and clearly describing PPPoE management interface support.
Linked Issues check ✅ Passed The PR implements PPPoE interface detection with proper naming prefix handling, directly addressing issue #258's requirement to detect IP addresses of PPPoE management interfaces.
Out of Scope Changes check ✅ Passed All changes are directly related to PPPoE support: net.lua adds protocol checking, test_net.lua adds corresponding tests, and runtests runs the new test suite.
Bug Fixes ✅ Passed Fix properly addresses PPPoE interface detection root cause; regression test reproduces bug scenario, would fail without patch, is deterministic, and correctly integrated.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openwisp-companion

Copy link
Copy Markdown

Commit Message Style Failure

Hello @tizbac,
(Analysis for commit 42d80d7)

Your commit message is missing a required prefix in the short description.
Please format your commit message according to the OpenWISP guidelines.

Correct Format Example:

[feature/tag] Short capitalized title of the change #<issue_number>

Detailed explanation of the changes made, including the problem being solved
and the approach taken. This section should be separated from the header
by a blank line.

Fixes #<issue_number>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openwisp-config/files/lib/openwisp/net.lua`:
- Around line 10-15: Add a regression test that exercises the PPPoE branch:
create a temporary UCI network section with name "<section_name>" and set
proto='pppoe' and a known address, then invoke the code path that resolves
interface names (the logic using uci_cursor:get(...,'proto') and the
is_pppoe/ifname branch in net.lua or by calling the public entry used by
openwisp-get-address) and assert the resolved interface name equals
"pppoe-<section_name>" and the returned address matches the known address; place
the test alongside existing network/net.lua tests and mirror their
setup/teardown of UCI state so it is isolated and repeatable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5a3cf27e-77be-421d-9274-65d89dd273b0

📥 Commits

Reviewing files that changed from the base of the PR and between f273348 and 42d80d7.

📒 Files selected for processing (1)
  • openwisp-config/files/lib/openwisp/net.lua
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: QA-Checks and Tests
  • GitHub Check: Kilo Code Review

Comment thread openwisp-config/files/lib/openwisp/net.lua
@nemesifier nemesifier changed the title Support PPPoE management interfaces in openwisp [fix] Added support for PPPoE management interfaces May 29, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to In progress in 26.06 Release May 29, 2026
@kilo-code-bot

kilo-code-bot Bot commented May 29, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • openwisp-config/files/lib/openwisp/net.lua
  • openwisp-config/tests/test_net.lua
  • runtests

Reviewed by gpt-5.4-20260305 · 18,436 tokens

@nemesifier

Copy link
Copy Markdown
Member

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

@nemesifier nemesifier force-pushed the tizbac-patch-pppoe branch from a8ae8d8 to a4610a2 Compare May 29, 2026 14:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openwisp-config/tests/test_net.lua`:
- Around line 33-51: The tests TestNet.test_get_interface_uses_bridge_prefix and
TestNet.test_get_interface_uses_pppoe_prefix currently only assert
interface.name; update both to also assert the resolved IP by checking
interface.addr equals the expected addr (e.g., '192.168.1.1' for br-lan and
'192.0.2.1' for pppoe-wan) so net.get_interface's returned nixio entry
(interface.addr) is validated; locate the assertions in those test_* functions
and add luaunit.assertEquals(interface.addr, '<expected ip>') for each case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 380f05ae-8436-4aee-ba6b-8d7eb7a5b582

📥 Commits

Reviewing files that changed from the base of the PR and between f273348 and a8ae8d8.

📒 Files selected for processing (3)
  • openwisp-config/files/lib/openwisp/net.lua
  • openwisp-config/tests/test_net.lua
  • runtests
📜 Review details
🔇 Additional comments (3)
openwisp-config/files/lib/openwisp/net.lua (1)

10-20: LGTM!

runtests (1)

12-12: LGTM!

openwisp-config/tests/test_net.lua (1)

6-31: LGTM!

Comment thread openwisp-config/tests/test_net.lua
@nemesifier nemesifier force-pushed the tizbac-patch-pppoe branch from a4610a2 to 95870e5 Compare May 29, 2026 15:20
@github-project-automation github-project-automation Bot moved this from In progress to Reviewer approved in OpenWISP Priorities for next releases May 29, 2026
@openwisp-companion

Copy link
Copy Markdown

Proposed change log entry:

[fix] Support PPPoE management interfaces #258

The interface protocol is checked for it being `pppoe`. If true, `pppoe-` is prepended to the interface name, similar to how it is done for bridge interfaces. This ensures that PPPoE management interfaces are correctly detected and their IP addresses can be retrieved.

Closes #258

@nemesifier

Copy link
Copy Markdown
Member

Thanks @tizbac 🙏

FYI, we have a matrix dev chat if you ever need to discuss changes.

@nemesifier nemesifier merged commit a2136d9 into openwisp:master May 29, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in 26.06 Release May 29, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in OpenWISP Priorities for next releases May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

[bug] IP Address of PPPoE management interfaces is not detected

2 participants