Check IP address before updating settings 01/238501/1 accepted/tizen/unified/20200721.042532 submit/tizen/20200720.040532
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 14 Jul 2020 11:47:07 +0000 (20:47 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 14 Jul 2020 11:47:13 +0000 (20:47 +0900)
commit4bbe93f77ca28ed669a7b87228f330b9d51e5f3f
tree3142464c6a5838bccd83e639eca822197a575fdd
parenta68e2d41e777430e50f3b5df38b93d721a56572e
Check IP address before updating settings

If IP address string is empty, inet_addr() returns 0xFFFFFFFF.
ioctl() doesn't return error value when 0xFFFFFFFF is passed on RPI4.
It's because class-e address has been allowed via ifconfig ioctl since
kernel 4.20.

This patch checks IP address before updating settings to avoid
assigning unexpected IP to tun.

Change-Id: Ic588eb5d66d10afa2cc45955546705cafe27a1c3
include/capi_vpn_service_private.h
src/capi_vpn_service.c