Commit 3b4201bd authored by Simon Redman's avatar Simon Redman

Use SRv6 next-hop when available for determining the output interface

parent 6e580290
......@@ -173,8 +173,15 @@ class nlsdnController():
routes = self.get_ipv6_routes(nlsdn_id)
# Find the route which leads towards the destination of this rule
dest_ip = match.get_match_fields()['ipv6_dst']
# Find the route which leads towards the destination of this action
segs = action.get_actions_fields()['srv6_dst']
if len(segs) == 0:
# No segments? Okay, just use the default destination of the flow
# (Could probably bail at this point and let default kernel routing handle this case but whatever)
dest_ip = match.get_match_fields()['ipv6_dst']
else:
# We are routing towards the first segment
dest_ip = segs[0]
route = None
for potential_route in routes:
......
......@@ -40,7 +40,7 @@ class Actions(object):
def _parse_field(field_name: str, field_value):
# TODO: rest of fields
if field_name == 'srv6_dst':
srv6_dsts: List[ipaddress.IPv6Address] = map(ipaddress.ip_address, field_value)
srv6_dsts: List[ipaddress.IPv6Address] = list(map(ipaddress.ip_address, field_value))
return srv6_dsts
raise UnknownActionException(field_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment