From 7e16cc15b5e16ec35f4c9f0516a6cacf90326856 Mon Sep 17 00:00:00 2001 From: Erik Kline Date: Tue, 1 Dec 2015 17:27:59 +0900 Subject: Switch from using sockaddr to sockaddr_storage. This is to ensure sufficient space is always available. Change-Id: Ifa87b93ecdc90dcacbfb24446c872344da6703d3 --- lmkd/lmkd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lmkd/lmkd.c') diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c index 7bbc81119..50bf6a4d5 100644 --- a/lmkd/lmkd.c +++ b/lmkd/lmkd.c @@ -410,7 +410,8 @@ static void ctrl_data_handler(uint32_t events) { } static void ctrl_connect_handler(uint32_t events __unused) { - struct sockaddr addr; + struct sockaddr_storage ss; + struct sockaddr *addrp = (struct sockaddr *)&ss; socklen_t alen; struct epoll_event epev; @@ -419,8 +420,8 @@ static void ctrl_connect_handler(uint32_t events __unused) { ctrl_dfd_reopened = 1; } - alen = sizeof(addr); - ctrl_dfd = accept(ctrl_lfd, &addr, &alen); + alen = sizeof(ss); + ctrl_dfd = accept(ctrl_lfd, addrp, &alen); if (ctrl_dfd < 0) { ALOGE("lmkd control socket accept failed; errno=%d", errno); -- cgit v1.2.3