Closed eycorsican closed 5 years ago
Some lint errors:
win32.js
15:3 error Unexpected var, use let or const instead no-var
17:56 error Strings must use doublequote quotes
17:74 error Strings must use doublequote quotes
Otherwise, approach looks good.
Lint errors fixed.
It's worth to note that this PR fixes the case where there are multiple default routes to their own gateways, but the current implementation still fails when there are multiple default routes with different metrics to the SAME gateway, though it a rare case.
Merged this in https://github.com/silverwind/default-gateway/commit/771706d18779d803eeab960c35fd17cd9046360b and did a rework of the parsing in https://github.com/silverwind/default-gateway/commit/1b6d124ab9811438db1d670fcdb30445814634ab.
Your version did not support multiple IP versions which I've added. Also, it seems the final metric seen in netstat -nr
is the sum of GatewayCostMetric and IPConnectionMetric, so I added that as well.
Maybe you can confirm that current master
branch works for you.
master
works well for me :)
Thanks, released in default-gateway@5.0.3
.
May fix #15