Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lwip): use dhcp_network_changed_link_up() (IDFGH-13780) #14640

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xobs
Copy link
Contributor

@xobs xobs commented Sep 27, 2024

Description

The function dhcp_network_changed() was renamed to dhcp_network_changed_link_up() upstream. Use the new function name.

Related

Fixes #14582

Testing

With this fix applied, I am able to build with CONFIG_LWIP_DHCP_RESTORE_LAST_IP. Additionally, network connectivity is restored very quickly.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@CLAassistant
Copy link

CLAassistant commented Sep 27, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Sep 27, 2024

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello xobs, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.

This GitHub project is public mirror of our internal git repository

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved, we synchronize it into our internal git repository.
4. In the internal git repository we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
5. If the change is approved and passes the tests it is merged into the default branch.
5. On next sync from the internal git repository merged change will appear in this public GitHub repository.

Generated by 🚫 dangerJS against a92b654

@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 27, 2024
@github-actions github-actions bot changed the title fix(lwip): use dhcp_network_changed_link_up() fix(lwip): use dhcp_network_changed_link_up() (IDFGH-13780) Sep 27, 2024
The function `dhcp_network_changed()` was renamed to
`dhcp_network_changed_link_up()` upstream. Use the new function name.

This closes espressif#14582.

Signed-off-by: Sean Cross <[email protected]>
@xobs xobs force-pushed the fix-lwip-dhcp-restore-last-ip branch from c60ec31 to a92b654 Compare September 27, 2024 10:41
@xobs
Copy link
Contributor Author

xobs commented Sep 27, 2024

Note: the runner is stating that I haven't installed the pre-commit hooks. However, I have done that, and have run git commit --amend. The pre-commit hooks have run:

[6:36:58 pm] ~/esp/esp-idf> git commit --amend
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\Sean\.cache\pre-commit\patch1727433437-28540.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/PyCQA/flake8.
[INFO] Initializing environment for https://github.com/asottile/reorder-python-imports.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for local.
[INFO] Initializing environment for local:cmakelint==1.4.1.
[INFO] Initializing environment for local:PyYAML == 5.3.1.
[INFO] Initializing environment for local:mypy,mypy-extensions,types-setuptools,types-PyYAML,types-requests.
[INFO] Initializing environment for local:jsonschema.
[INFO] Initializing environment for local:pyparsing.
[INFO] Initializing environment for local:PyYAML == 5.3.1,idf-build-apps~=2.0.
[INFO] Initializing environment for local:ruamel.yaml.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/espressif/check-copyright/.
[INFO] Initializing environment for https://github.com/espressif/conventional-precommit-linter.
[INFO] Initializing environment for https://github.com/espressif/astyle_py.git.
[INFO] Initializing environment for https://github.com/shellcheck-py/shellcheck-py.
[INFO] Initializing environment for https://github.com/espressif/esp-pwsh-check.
[INFO] Initializing environment for https://github.com/espressif/esp-idf-sbom.git.
[INFO] Initializing environment for https://github.com/sphinx-contrib/sphinx-lint.
[INFO] Initializing environment for https://github.com/espressif/esp-idf-kconfig.git.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/reorder-python-imports.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/espressif/check-copyright/.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/espressif/astyle_py.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/shellcheck-py/shellcheck-py.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/sphinx-contrib/sphinx-lint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/espressif/esp-idf-kconfig.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.....................................................................................(no files to check)Skipped
fix end of files.............................................................................................(no files to check)Skipped
check that executables have shebangs.........................................................................(no files to check)Skipped
mixed line ending............................................................................................(no files to check)Skipped
fix double quoted strings....................................................................................(no files to check)Skipped
Do not use more than one slash in the branch name................................................................................Passed
Do not use uppercase letters in the branch name..................................................................................Passed
flake8.......................................................................................................(no files to check)Skipped
Reorder Python imports.......................................................................................(no files to check)Skipped
codespell....................................................................................................(no files to check)Skipped
Check File Permissions.......................................................................................(no files to check)Skipped
Validate executable-list.txt.....................................................................................................Passed
Check if any Kconfig Options Deprecated......................................................................(no files to check)Skipped
Check CMake Files Format.....................................................................................(no files to check)Skipped
Validate Codeowner File..........................................................................................................Passed
Check rules are generated (based on .gitlab/ci/dependencies/dependencies.yml)................................(no files to check)Skipped
Check type annotations in python files.......................................................................(no files to check)Skipped
Check requirement files......................................................................................(no files to check)Skipped
Check tools dir files patterns...............................................................................(no files to check)Skipped
check patterns-build_components in rules.yml.................................................................(no files to check)Skipped
Check soc caps kconfig files are generated (based on components/soc/IDF_TARGET/include/soc/soc_caps.h).......(no files to check)Skipped
Check if all apps readme files match given .build-test-rules.yml files. Modify the supported target tables...(no files to check)Skipped
sort yaml files..............................................................................................(no files to check)Skipped
sort yaml test...............................................................................................(no files to check)Skipped
check path in .build-test-rules.yml exists.......................................................................................Passed
Remove non-existing patterns from ignore lists...................................................................................Passed
Check gitlab yaml files......................................................................................(no files to check)Skipped
File Contents Sorter.........................................................................................(no files to check)Skipped
Check copyright notices......................................................................................(no files to check)Skipped
astyle formatter.............................................................................................(no files to check)Skipped
shellcheck bash..............................................................................................(no files to check)Skipped
shellcheck dash (export.sh)..................................................................................(no files to check)Skipped
Lint rST files in docs folder using Sphinx Lint..............................................................(no files to check)Skipped
Check ESP-IDF KConfig Files..................................................................................(no files to check)Skipped
[INFO] Restored changes from C:\Users\Sean\.cache\pre-commit\patch1727433437-28540.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\Sean\.cache\pre-commit\patch1727433681-22132.
[INFO] Installing environment for https://github.com/espressif/conventional-precommit-linter.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Conventional Commit......................................................Passed
[INFO] Restored changes from C:\Users\Sean\.cache\pre-commit\patch1727433681-22132.
[fix-lwip-dhcp-restore-last-ip a92b654598] fix(lwip): use dhcp_network_changed_link_up()
 Date: Fri Sep 27 18:29:31 2024 +0800
 1 file changed, 1 insertion(+), 1 deletion(-)
[6:41:37 pm] ~/esp/esp-idf> git show
commit a92b654598fa82296f43520868e515c740060d23 (HEAD -> fix-lwip-dhcp-restore-last-ip)
Author: Sean Cross <[email protected]>
Date:   Fri Sep 27 18:29:31 2024 +0800

    fix(lwip): use dhcp_network_changed_link_up()

    The function `dhcp_network_changed()` was renamed to
    `dhcp_network_changed_link_up()` upstream. Use the new function name.

    This closes #14582.

    Signed-off-by: Sean Cross <[email protected]>

diff --git a/components/lwip/port/include/lwipopts.h b/components/lwip/port/include/lwipopts.h
index 15e2c4267b..7b0a2abae1 100644
--- a/components/lwip/port/include/lwipopts.h
+++ b/components/lwip/port/include/lwipopts.h
@@ -362,7 +362,7 @@ extern "C" {
  */
 #define LWIP_HOOK_DHCP_POST_INIT(netif, result) \
     (dhcp_ip_addr_restore(netif) ? ( dhcp_set_state(dhcp, DHCP_STATE_BOUND), \
-                                     dhcp_network_changed(netif), \
+                                     dhcp_network_changed_link_up(netif), \
                                      (result) = ERR_OK , \
         true ) : \
         false)
[6:41:42 pm] ~/esp/esp-idf> git push -f
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 24 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 672 bytes | 224.00 KiB/s, done.
Total 7 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
To github.com:farpatch/esp-idf.git
 + c60ec319c6...a92b654598 fix-lwip-dhcp-restore-last-ip -> fix-lwip-dhcp-restore-last-ip (forced update)
[6:41:52 pm] ~/esp/esp-idf>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CONFIG_LWIP_DHCP_RESTORE_LAST_IP fails to compile: dhcp_network_changed not defined (IDFGH-13710)
4 participants