Hi, On Fri, Jun 08, 2018 at 01:20:11PM +0800, Antonio Quartulli wrote: > From: Antonio Quartulli <[email protected]> > > Signed-off-by: Antonio Quartulli <[email protected]>
This commit message is a bit... thin.
> check_add_routes_dowork(struct context *c)
> {
> - if (test_routes(c->c1.route_list, c->c1.tuntap))
> + /* skip route check if no IPv4 was configured */
> + if (!c->c1.tuntap->did_ifconfig_setup
> + || test_routes(c->c1.route_list, c->c1.tuntap))
> {
> check_add_routes_action(c, false);
> }
And I'm not sure if that comment is sufficient to explain this increasingly
convoluted function... (I'm so totally not understanding what is happening
here, and how it's wrapped into the event looping)
Maybe a easier to understand place for the did_ifconfig_setup check would
be inside test_routes()?
Like:
- if (rl)
+ /* we do this test only if we have IPv4 routes to install, and if
+ * the tun/tap interface has seen ipv4 ifconfig - because if we
+ * have no IPv4, the check will always fail, failing tun init
+ */
+ if (rl && tt->did_ifconfig_setup)
But really, WTF...
gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
