From owner-freebsd-net@FreeBSD.ORG Fri Jul 2 09:07:07 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD1DA16A4CE for ; Fri, 2 Jul 2004 09:07:07 +0000 (GMT) Received: from web13010.mail.yahoo.com (web13010.mail.yahoo.com [216.136.172.91]) by mx1.FreeBSD.org (Postfix) with SMTP id 89B1A43D1D for ; Fri, 2 Jul 2004 09:07:07 +0000 (GMT) (envelope-from rosey_kc@yahoo.com) Message-ID: <20040702090540.990.qmail@web13010.mail.yahoo.com> Received: from [202.51.78.5] by web13010.mail.yahoo.com via HTTP; Fri, 02 Jul 2004 02:05:40 PDT Date: Fri, 2 Jul 2004 02:05:40 -0700 (PDT) From: kamal kc To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: newbie: segmentation fault X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 09:07:07 -0000 first of all thanks for solving my previous problem. my previous problem was about the ip and ethernet header. this is how i solved it: -------- char *sender,*dest; char *ptr; struct ether_header eth; ptr=pcap_next(..); sender=ether_ntoa(ether->s_host); printf("%s", sender); dest=ether_ntoa(ether->d_host); printf("%s",dest); ------------------------------------------------------------------------- The above code did the trick. NOW i face a bizarre problem; when i write the following piece of code it successfully gets compiled but generates segmentation fault when run. ---- struct sockaddr_in *sock; sock->sin_family=AF_INET; /* rest of the code */ ------ And i also don't know much about the segmentation fault error message. By the way can i know about it in the man pages. if there are any please mention. Kamal --------------------------------- Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage!