net/netdev: rework SIOCGIFCONF support
authorHeesub Shin <heesub.shin@samsung.com>
Thu, 18 May 2017 16:26:36 +0000 (01:26 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 23 May 2017 12:40:05 +0000 (21:40 +0900)
commitcfe921e08fef770af9b71a117a611ec57f00613b
tree2d8a2e83ab3a8d0bc58b0db9ab3a59372d2bb19d
parent47db3fb5c149f4507b22ea4f60e4c14166e70e25
net/netdev: rework SIOCGIFCONF support

I do not know the background history on netdev_foreach_sync(), but it is
reinventing the wheel which we should avoid as always as possible.
TizenRT already provides a general interface, netdev_foreach() and thus
it does not make any sense to introduce netdev_foreach_sync(), breaking
the OS design. Adding a new API or code in such a way all the time will
make the OS bigger and bigger.

This commit also fixes a buffer overflow issue that might occur when not
enough buffer were passed to ioctl().

Change-Id: Id52c328919efc8d5ba57548af323e3d69335ff9e
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/include/tinyara/net/net.h
os/net/netdev/netdev_foreach.c
os/net/netdev/netdev_ioctl.c