--- ansh/src/utils.c 2011/10/17 20:14:02 1.2 +++ ansh/src/utils.c 2011/10/31 09:46:18 1.2.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.2 2011/10/17 20:14:02 misho Exp $ + * $Id: utils.c,v 1.2.2.1 2011/10/31 09:46:18 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -133,7 +133,6 @@ PrepareL3(const struct sockaddr *sa, int *bpflen) int h, n = 1; FTRACE(3); - assert(sa); h = socket(sa->sa_family, SOCK_RAW, IPPROTO_ICMP); if (h == -1) { @@ -147,7 +146,7 @@ PrepareL3(const struct sockaddr *sa, int *bpflen) return -1; } */ - if (bind(h, sa, sizeof(struct sockaddr)) == -1) { + if (sa && bind(h, sa, sizeof(struct sockaddr)) == -1) { printf("Error:: Cant bind to raw socket #%d - %s\n", errno, strerror(errno)); close(h); return -1;