Browse code

b/f: fixed getsockopt setting bug in sip transport when setting rcvbuf size

Patch by Robert Szokovacs

Stefan Sayer authored on 12/09/2013 18:41:18
Showing 1 changed files
... ...
@@ -120,8 +120,8 @@ int udp_trsp_socket::bind(const string& bind_ip, unsigned short bind_port)
120 120
 	    WARN("could not set SIP UDP socket buffer: '%s'\n",
121 121
 		 strerror(errno));
122 122
 	} else {
123
-	    socklen_t optlen;
124 123
 	    int set_rcvbuf_size=0;
124
+	    socklen_t optlen = sizeof(int);
125 125
 	    if (getsockopt(sd, SOL_SOCKET, SO_RCVBUF,
126 126
 			   &set_rcvbuf_size, &optlen) == -1) {
127 127
 		WARN("could not read back SIP UDP socket buffer length: '%s'\n",