--- ansh/src/utils.c 2011/10/31 09:46:18 1.2.2.1 +++ ansh/src/utils.c 2011/10/31 10:09:52 1.2.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.2.2.1 2011/10/31 09:46:18 misho Exp $ + * $Id: utils.c,v 1.2.2.2 2011/10/31 10:09:52 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -134,7 +134,7 @@ PrepareL3(const struct sockaddr *sa, int *bpflen) FTRACE(3); - h = socket(sa->sa_family, SOCK_RAW, IPPROTO_ICMP); + h = socket(sa ? sa->sa_family : AF_INET, SOCK_RAW, IPPROTO_ICMP); if (h == -1) { printf("Error:: Cant open raw socket #%d - %s\n", errno, strerror(errno)); return -1;