From 3889612488bf47f0abc9670c63fa1aeecbfdb086 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 2 Dec 2014 14:24:19 +0300 Subject: [PATCH] be: replace sockaddr_storage with sockaddr_in6 for conn_address We need only ipv6/ipv4 for connect in bufferevent, and since sockaddr_storage is pretty big (128 bytes) it will be better to use sockaddr_in6 here (it will fit ipv4 too). --- bufferevent-internal.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bufferevent-internal.h b/bufferevent-internal.h index d2fea232..fb5e6a69 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -213,7 +213,10 @@ struct bufferevent_private { * So we need to save it, just after we connected to remote server, or * after resolving (to avoid extra dns requests during retrying, since UDP * is slow) */ - struct sockaddr_storage conn_address; + union { + struct sockaddr_in6 in6; + struct sockaddr_in in; + } conn_address; }; /** Possible operations for a control callback. */ -- 2.40.0