-
Notifications
You must be signed in to change notification settings - Fork 140
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
Refactor 'addressmanager', reorder fetching sources for-external ip #300
Refactor 'addressmanager', reorder fetching sources for-external ip #300
Commits on Oct 24, 2023
-
Refactor 'addressmanager' to improve readability and maintainability
The 'addressmanager' component of the codebase has been thoroughly refined for improved readability and maintainability. Firstly, the logic for assigning local network addresses has been streamlined and broken down into smaller methods for more clarity. Old methods 'add_routable_addresses_from_net_interfaces' and 'configured_address' have been replaced by 'routable_addresses_from_net_interfaces', 'local_addresses', and 'upnp'. This also led to the removal of redundant code.
Configuration menu - View commit details
-
Copy full SHA for ae725b6 - Browse repository at this point
Copy the full SHA ae725b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a76413f - Browse repository at this point
Copy the full SHA a76413fView commit details -
Refactor upnp error handling and add UpnpError enum
Introduced thiserror dependency and created UpnpError enum in the addressmanager module. The enum encapsulates possible errors from Universal plug and play (upnp) functionality in idg_next crate, providing a more granular approach to error handling. The upnp function was also refactored to return a Result type - improving code readability and easing error propagation.
Configuration menu - View commit details
-
Copy full SHA for c1d3e7c - Browse repository at this point
Copy the full SHA c1d3e7cView commit details -
Update log messages to include UPnP context
Modified log messages in the addressmanager and port_mapping_extender modules to improve readability by including the '[UPnP]' context. The messages were updated in multiple sections where the upnp() function was used, thus helping in easier identification and debugging of UPnP related issues.
Configuration menu - View commit details
-
Copy full SHA for 1afbbb6 - Browse repository at this point
Copy the full SHA 1afbbb6View commit details -
Add UPnP context to existing port mapping detection
Enhanced the port mapping detection functionality in the address manager to handle cases where the default port is already in use by another service. This change allows the gateway to map to a random external port if the default one is already mapped. This is crucial for avoiding port mapping conflicts under UPnP protocol, and hence, improving the robustness of the network setup process.
Configuration menu - View commit details
-
Copy full SHA for b490ddf - Browse repository at this point
Copy the full SHA b490ddfView commit details -
Refactor existing port mapping check logic in UPnP
Refactored the logic used to check whether the default external port is already mapped under UPnP in the address manager. The changes allow the application to handle scenarios where the port is in use by another service more effectively, ultimately enabling the gateway to map to another external port when required. This refinement is critical for averting potential port mapping conflicts, thereby enhancing the reliability of the network initialization process.
Configuration menu - View commit details
-
Copy full SHA for 519b4a2 - Browse repository at this point
Copy the full SHA 519b4a2View commit details -
Add cleanup logic for UPnP port removal
Added an additional step to handle the removal of a mapped port in the Universal Plug and Play (UPnP) protocol when stopping a service. Included a warning message if the port removal fails and an informational message upon successful removal. This enhancement improves service lifecycle management by ensuring that resources are appropriately released when a service is stopped, preventing potential port leaking issues.
Configuration menu - View commit details
-
Copy full SHA for e8cc440 - Browse repository at this point
Copy the full SHA e8cc440View commit details -
Configuration menu - View commit details
-
Copy full SHA for 557b50a - Browse repository at this point
Copy the full SHA 557b50aView commit details -
"Handle specific port mapping errors in address manager
Updated the address manager component to specifically handle `RequestError` and `SpecifiedArrayIndexInvalid` errors from the `GetGenericPortMappingEntry` method. This change results in improved error logging and handling, improving overall reliability of the UPnP functionality."
Configuration menu - View commit details
-
Copy full SHA for 8796124 - Browse repository at this point
Copy the full SHA 8796124View commit details -
Configuration menu - View commit details
-
Copy full SHA for 373f826 - Browse repository at this point
Copy the full SHA 373f826View commit details -
Configuration menu - View commit details
-
Copy full SHA for 406a314 - Browse repository at this point
Copy the full SHA 406a314View commit details -
Refactor itertools usage in addressmanager
This commit simplifies the use of the itertools library in our address manager module to improve readability. Instead of using the full `itertools::Either::` syntax every time, we've destructured `Either::{Left, Right}` at the beginning, allowing for leaner and semantically clearer code.
Configuration menu - View commit details
-
Copy full SHA for 76b3fcc - Browse repository at this point
Copy the full SHA 76b3fccView commit details
Commits on Oct 25, 2023
-
This commit introduces a documentary comment explaining the loop that
checks for existing port mappings in the UPnP-enabled Internet Gateway Device (IGD). The clarification helps developers understand the necessity of this loop, especially in scenarios where the IGD might not explicitly signal port conflicts.
Configuration menu - View commit details
-
Copy full SHA for 748b0d8 - Browse repository at this point
Copy the full SHA 748b0d8View commit details