summaryrefslogtreecommitdiff
path: root/vpn/plugins/wireguard.c
AgeCommit message (Collapse)AuthorFilesLines
2021-09-21Fix: Memory leak issue when tokenizing stringsubmit/tizen/20210924.013637accepted/tizen/unified/20210924.055913Nishant Chaprana1-0/+3
Change-Id: I71e88bb35384cf919263fa5dda8c4f0f06be6ef2 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-09-08wireguard: Add routes for allowedIPsNishant Chaprana1-0/+205
Change-Id: Iad4c994dc7e40589f17db7c1b590cf7673b21bc0 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-08-04wireguard: Save plugin related settings in config fileNishant Chaprana1-0/+104
Change-Id: I76d12fa347d1211958463ccf38a043a0c6272ece Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-07-13wireguard: Copy interfance names obeying lengths rulesDaniel Wagner1-1/+1
gcc points out the destination buffer has the same size the specified bound for the string. warning: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] Let's make sure we do not overflow the buffer (should not happen as the names are provide by the kernel and hence should fit). Change-Id: I1e8818f0820ffb32083e14cb88e4919fd8b12798 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-07-13vpn: Export vpn_ipconfig_foreach as linker symbolDaniel Wagner1-1/+1
Commit 95b25140bec7 ("vpn: Add WireGuard support") introduced a plugin dependency to __vpn_ipconfig_foreach. Because the linker does not export the prefixed functions, we need to rename it to vpn_ipconfig_foreach in order to export the linker symbol. Change-Id: I105159739dece4a675fa074ef304c6fd4d7b88bf Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-07-13wireguard: Fix struct sockaddr usageDaniel Wagner1-22/+25
wg_dns_reresolve_cb() tries to read 16 bytes from the addr variable in case of IPv6 but struct sockaddr has size of 8 bytes. Introduce a helper struct containing IPv4 and IPv6 sockaddr as superset of all IP based sockaddr. This helper struct is identically to the 'union endpoint' in wireguard.h. But we don't want to touch this header file as it is 100% copy from the upstream WireGuard project. Fixes: 90592f7a5835 ("wireguard: Regular reresolve endpoint address") Change-Id: I2b262e61e52c795ab0cab4b206bd25df8ae57738 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-07-13wireguard: Regular reresolve endpoint addressDaniel Wagner1-7/+80
In case the WireGuard endpoint is hosted on a dynamic IP address, the endpoint might change during runtime. Reresolve the endpoint on a regular basis and update the WireGuard device when it IP address has changed. Reported by Christian Hewitt Change-Id: Ice3b554a064585fb03ae8a7a89baccbe53e8576b Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2021-01-04Imported Upstream connman version 1.38Niraj Kumar Goit1-0/+404
Change-Id: I9e650762f3b2b2a31945b66e044e67a77e3b4b12 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>