zehome / MLVPN

Multi-link VPN (ADSL/SDSL/xDSL/Network aggregation / bonding)
http://www.mlvpn.fr/
BSD 2-Clause "Simplified" License
521 stars 127 forks source link

Parse 5-digit ports #87

Closed nesro closed 8 years ago

nesro commented 8 years ago

I tried MLVPN with a 5-digit port , but it has been trimmed to 4-digit number.

I did not debug the code, since my change solved the problem. But this is my guess what went wrong:

define MLVPN_MAXPORTSTR 5

char destport[MLVPN_MAXPORTSTR]; strlcpy(tmptun->destport, dstport, sizeof(tmptun->destport));

strlcpy guarantee to NUL-terminate the result, which leaves only 4 characters for the port

zehome commented 8 years ago

That's right.

zehome commented 8 years ago

Thank you for your contribution