--- a/src/emu/model/emu-net-device.cc Sun Apr 17 20:06:22 2011 -0700 +++ a/src/emu/model/emu-net-device.cc Mon Apr 18 10:57:56 2011 +0400 @@ -548,7 +548,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 @@ -601,6 +601,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 @@ -609,6 +610,7 @@ } } } + delete[] control; NS_FATAL_ERROR ("Did not get the raw socket from the socket creator"); } } --- a/src/emu/model/emu-sock-creator.cc Sun Apr 17 20:06:22 2011 -0700 +++ a/src/emu/model/emu-sock-creator.cc Mon Apr 18 10:57:56 2011 +0400 @@ -131,7 +131,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 @@ -186,6 +186,7 @@ // Actually send the file descriptor back to the emulated net device. // ssize_t len = sendmsg(sock, &msg, 0); + delete[] control; ABORT_IF (len == -1, "Could not send socket back to emu net device", 1); LOG ("sendmsg complete");