From e00e06c037d15a336c42c9b0e11bed95e2f4c85c Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 11 Apr 2019 14:06:44 +0200 Subject: [PATCH] netty_epoll_linuxsocket_setTcpMd5Sig should throw ChannelException when not able to init sockaddr Motivation: When netty_epoll_linuxsocket_setTcpMd5Sig fails to init the sockaddr we should throw an exception and not silently return. Modifications: Throw exception if init of sockaddr fails. Result: Correctly report back error to user. --- transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c b/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c index a2167224ca..2ad2cbf8b5 100644 --- a/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c +++ b/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c @@ -292,6 +292,7 @@ static void netty_epoll_linuxsocket_setTcpMd5Sig(JNIEnv* env, jclass clazz, jint struct sockaddr_storage addr; socklen_t addrSize; if (netty_unix_socket_initSockaddr(env, address, scopeId, 0, &addr, &addrSize) == -1) { + netty_unix_errors_throwChannelExceptionError(env, "Could not init sockaddr"); return; }