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 invalid routes(ipv6) added to upf module #885

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

sureshmarikkannu
Copy link
Contributor

No description provided.

Comment on lines 382 to 383
if not type(ipaddress.ip_address(route_entry.next_hop_ip)) is ipaddress.IPv4Address:
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the MAC for next hop is not already stored, then it will try to probe it using self._probe_addr and everything works as expected because self._probe_addr only tries IPv4 addresses. The issue will show up only if the MAC for the next hop is already stored. So, what I would recommend is to move validate_ipv4 from _probe_addr to add_new_route_entry. What do you think?

     def _probe_addr(self, route_entry: RouteEntry) -> None:
         """Probes the MAC address of a neighbor.
         Pings the neighbor to trigger the update of the ARP table.

         Args:
            route_entry (NeighborEntry): The neighbor entry.
         """
         self._unresolved_arp_queries_cache[route_entry.next_hop_ip] = route_entry
         logger.info("Adding entry %s in arp table by pinging", route_entry)
-        if not validate_ipv4(route_entry.next_hop_ip):
-            return
         send_ping(route_entry.next_hop_ip)

     def _get_gate_idx(self, route_entry: RouteEntry, module_name: str) -> int:

To here:

Suggested change
if not type(ipaddress.ip_address(route_entry.next_hop_ip)) is ipaddress.IPv4Address:
return
if not validate_ipv4(route_entry.next_hop_ip):
return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

+1

@gab-arrobo gab-arrobo merged commit 6483084 into omec-project:main Feb 20, 2025
12 checks passed
@sureshmarikkannu sureshmarikkannu deleted the ipv6_issue branch February 20, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants