diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-08 13:40:58 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-08 13:40:58 +0200 |
commit | f7aa797e802bc111dd6a0136cef063ef7283e87d (patch) | |
tree | b684105d054fb080615bc826d8475f6e0374ffa8 | |
parent | d3c9eca81e94978284e619aca58cee93977f30a7 (diff) | |
download | pingu-f7aa797e802bc111dd6a0136cef063ef7283e87d.tar.bz2 pingu-f7aa797e802bc111dd6a0136cef063ef7283e87d.tar.xz |
pingu_iface: only update multpath route when route is a default gw
We now save all routes in list but we don't need update multipath
routes unless the changed route is a default gateway.
-rw-r--r-- | pingu_iface.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pingu_iface.c b/pingu_iface.c index 60b9fa5..cb8d584 100644 --- a/pingu_iface.c +++ b/pingu_iface.c @@ -155,14 +155,15 @@ void pingu_iface_gw_action(struct pingu_iface *iface, switch (action) { case RTM_NEWROUTE: pingu_gateway_add(&iface->gateway_list, gw); - log_debug("%s: added default gateway", iface->name); + log_debug("%s: added route", iface->name); break; case RTM_DELROUTE: pingu_gateway_del(&iface->gateway_list, gw); - log_debug("%s: removed default gateway", iface->name); + log_debug("%s: removed route", iface->name); break; } - kernel_route_multipath(action, &iface_list, RT_TABLE_MAIN); + if (is_default_gw(gw)) + kernel_route_multipath(action, &iface_list, RT_TABLE_MAIN); } void pingu_iface_update_routes(struct pingu_iface *iface, int action) |