openwrt route_allowed_ips is inprecise

Jason A. Donenfeld Jason at zx2c4.com
Tue Dec 20 04:14:06 CET 2016


Hey Baptiste,

On Tue, Dec 20, 2016 at 2:13 AM, Baptiste Jonglez
<baptiste at bitsofnetworks.org> wrote:

> By the way, besides the issue of magic, this approach seems incorrect
> depending on the order of the routes.  Consider the case where cmd_add()
> handles the following sequence of allowed-ips:
>
>     10.0.0.0/8   dev wg0
>     10.4.7.0/24  dev wg0
>     10.4.0.0/16  dev wg1
>
> Your method would incorrectly drop the second route, and then the third
> route would take over traffic for this /24 through the wrong interface.

Very smart point and astute observation! This should be fixed here:

https://git.zx2c4.com/WireGuard/commit/?id=5838c950859f1b55ad344e81b77a0b71917ffd61

Unless there are objections, that will ship with the next snapshot.

Jason


More information about the WireGuard mailing list