Closed michael-o closed 6 years ago
Basically, UpnpInit()
is deprecated. Looks like bad habit using deprecated methods in sample code. Moreover, it does not hurt to bind against IPv6 too if a null interface is provided. If no IPv6 is configured, it won't bind anyway. This is just a cleanup.
At best, UpnpInit2()
would receive a third argument with an enum value saying IPV4
, IPV6
or IPV4_IPV6
.
Ok, you are right. Committed.
This commit breaks compiling after ./configure --disable-ipv6
.
So we need defined around it and fall back to UpnpInit()
if IPv6 has been disabled. Does this make sense?
@michael-o yes, thats the fix.
I wonder why there are two init functions. If you ask me the right fix is that libupnp provides UpnpInit2 always. Its a PITA to have different functions provided in a lib depending on configure flags anyhow. Strictly speaking it is wrong to let libupnp with and without UpnpInit2 have the same library version numbers.
@ukleinek I agree, less is more in this case.
In fact, @michael-o has already fixed UpnpInit2()
to work without IPv6 being available at runtime, but I am not sure if there are still compile time dependencies.
I have committed a possible fix, please check it. Don't know about possible compile time dependencies, though.
Hi, Michael,
Would you mind elaborate a bit on your proposal?
Why should we change the initialization on the sample code? I agree we lack a sample with IPV6, so maybe we could create a runtime option to the sample, so that the user could choose if he wants IPV4 or IPV6.
What do you think?
Regards, Marcelo.