IPACM: increase netlink socket buffer size
looks like in some customer's builds, the netlink socket
messages are missing due to the unsufficient socket buffer
size. In order to resolve this, we increase the socket
buffer size.
Change-Id: I0b76e8d2ece47043801be405c85166bf6000c2f3
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
diff --git a/ipacm/src/IPACM_Netlink.cpp b/ipacm/src/IPACM_Netlink.cpp
old mode 100644
new mode 100755
index e2470a8..1e6d58c
--- a/ipacm/src/IPACM_Netlink.cpp
+++ b/ipacm/src/IPACM_Netlink.cpp
@@ -64,7 +64,9 @@
)
{
int *p_sk_fd;
+ int buf_size = 6669999, sendbuff=0, res;
struct sockaddr_nl *p_sk_addr_loc;
+ socklen_t optlen;
p_sk_fd = &(sk_info->sk_fd);
p_sk_addr_loc = &(sk_info->sk_addr_loc);
@@ -76,6 +78,20 @@
return IPACM_FAILURE;
}
+ optlen = sizeof(sendbuff);
+ res = getsockopt(*p_sk_fd, SOL_SOCKET, SO_SNDBUF, &sendbuff, &optlen);
+
+ if(res == -1)
+ IPACMDBG("Error getsockopt one");
+ else
+ IPACMDBG("orignal send buffer size = %d\n", sendbuff);
+
+ IPACMDBG("sets the send buffer to %d\n", buf_size);
+ if (setsockopt(*p_sk_fd, SOL_SOCKET, SO_RCVBUF, &buf_size, sizeof(int)) == -1) {
+ IPACMERR("Error setting socket opts\n");
+ }
+
+
/* Initialize socket addresses to null */
memset(p_sk_addr_loc, 0, sizeof(struct sockaddr_nl));