diff -r 7b2e9458bff1 src/tap-bridge/model/tap-bridge.cc --- a/src/tap-bridge/model/tap-bridge.cc Sun Apr 17 20:06:22 2011 -0700 +++ b/src/tap-bridge/model/tap-bridge.cc Mon Apr 18 11:02:30 2011 +0400 @@ -599,7 +599,7 @@ // so we call it "control." // size_t msg_size = sizeof(int); - char control[CMSG_SPACE(msg_size)]; + char* control = new char[CMSG_SPACE (msg_size)]; // // There is a msghdr that is used to minimize the number of parameters @@ -649,6 +649,7 @@ int *rawSocket = (int*)CMSG_DATA (cmsg); NS_LOG_INFO ("Got the socket from the socket creator = " << *rawSocket); m_sock = *rawSocket; + delete[] control; return; } else @@ -657,6 +658,7 @@ } } } + delete[] control; NS_FATAL_ERROR ("Did not get the raw socket from the socket creator"); } } diff -r 7b2e9458bff1 src/tap-bridge/model/tap-creator.cc --- a/src/tap-bridge/model/tap-creator.cc Sun Apr 17 20:06:22 2011 -0700 +++ b/src/tap-bridge/model/tap-creator.cc Mon Apr 18 11:02:30 2011 +0400 @@ -213,7 +213,7 @@ // so we call it "control." // size_t msg_size = sizeof(int); - char control[CMSG_SPACE(msg_size)]; + char* control = new char[CMSG_SPACE (msg_size)]; // // There is a msghdr that is used to minimize the number of parameters @@ -268,6 +268,7 @@ // Actually send the file descriptor back to the tap bridge. // ssize_t len = sendmsg(sock, &msg, 0); + delete[] control; ABORT_IF (len == -1, "Could not send socket back to tap bridge", 1); LOG ("sendmsg complete");