Skip to content

Commit

Permalink
fix replacement of exclude routes and simplify for gateway route
Browse files Browse the repository at this point in the history
  • Loading branch information
dlenski committed May 26, 2020
1 parent 7152903 commit aa8a1e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vpn_slice/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ def do_connect(env, args):

# set explicit route to gateway
gwr = providers.route.get_route(env.gateway)
providers.route.replace_route(
env.gateway, **{k: gwr.get(k) for k in ('via', 'dev', 'src', 'mtu')})
providers.route.replace_route(env.gateway, **gwr)

# drop incoming traffic from VPN
if not args.incoming:
Expand Down Expand Up @@ -182,7 +181,7 @@ def do_connect(env, args):

# restore routes to excluded subnets
for dest, exc_route in exc_subnets:
providers.route.replace_route(dest, exc_route)
providers.route.replace_route(dest, **exc_route)
else:
providers.route.flush_cache()
if args.verbose:
Expand Down

0 comments on commit aa8a1e7

Please sign in to comment.