Hi,

On Sun, Nov 20, 2016 at 4:53 PM, Selva Nair <selva.n...@gmail.com> wrote:

>
>
> On Sun, Nov 20, 2016 at 11:45 AM, Gert Doering <g...@greenie.muc.de>
> wrote:
>
>> This defines a new DHCP suboption "DNS6", but does not actually
>> implement anything but "document the option and understand it".
>>
>> If received, it will be put into an "foreign_option_<n>" environment
>> variable where an --up script or plugin could receive and act upon it.
>>
>> On non-Windows platforms, all "dhcp-option" sub-options end up there,
>> so v4 and v6 DNS options will be reflected like this:
>>
>>    foreign_option_1=dhcp-option DNS6 2001:608::2
>>    foreign_option_2=dhcp-option DNS 195.30.0.2
>>
>
>
> Good enough to get the ball rolling. ACK.
>

I spoke too fast... There is a subtle problem here

+      else if (streq (p[1], "DNS6") && p[2])
> +       {
> +         /* this is somewhat of a placeholder - we understand the option,
> +          * but cannot act upon it - so we'll just accept it and put it
> +          * into the environment, as we would do on all non-win32
> platforms
> +          */
> +         foreign_option (options, p, 3, es);
> +       }
>

At the end of the "dhcp-option" parsing block there is a

o->dhcp_options = true;

which should be set only if there is a true DHCP option in the config. When
DNS6 is the only dhcp-option this causes an empty dhcp-option string being
created and the tap IOCTL to set dhcp fails.

Ading a "goto err;", though ugly and confusing, will fix it..

Selva
------------------------------------------------------------------------------
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to