From: Sapan Bhatia Date: Fri, 17 Sep 2010 16:14:08 +0000 (-0400) Subject: Bug fix: Receive control channel from vsys X-Git-Tag: vsys-scripts-0.95-21~2 X-Git-Url: http://git.onelab.eu/?p=vsys-scripts.git;a=commitdiff_plain;h=a1dc32daf05e48ef2c1e36650fc3b4d1a4c48bd5 Bug fix: Receive control channel from vsys --- diff --git a/fd_packetseer.c b/fd_packetseer.c index f4b2899..6c9089b 100644 --- a/fd_packetseer.c +++ b/fd_packetseer.c @@ -34,11 +34,13 @@ main(int argc, char *argv[]) exit(1); } + sscanf(argv[2],"%d", &control_channel_fd); magic_socket = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (magic_socket == -1) { fprintf(stderr, "Error creating socket: %d\n", errno); exit(1); } + else fprintf(stderr, "Socket: %d", magic_socket); send_fd(control_channel_fd, magic_socket); } diff --git a/fdpass.c b/fdpass.c index 5548064..6bf4692 100644 --- a/fdpass.c +++ b/fdpass.c @@ -41,6 +41,7 @@ int send_fd(int sock_fd, int fd) while ((retval = sendmsg(sock_fd, &msg, 0)) == -1 && errno == EINTR); if (retval != 1) { perror("sending file descriptor"); + fprintf(stderr,"File descriptor: %d", sock_fd); return -1; } return 0;