Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix-wizards Subject: Re: recvfrom() on raw sockets sometimes gives bad source address Message-ID: <1204@umcp-cs.UUCP> Date: Sun, 18-Nov-84 01:34:34 EST Article-I.D.: umcp-cs.1204 Posted: Sun Nov 18 01:34:34 1984 Date-Received: Tue, 20-Nov-84 06:41:40 EST References: <1008@hammer.UUCP> Distribution: net Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 23 Keywords: Network, 4.2Bsd > The bug fix you suggested is close, but incorrect. > The sbappendaddr routine free's its input chain if it is sucessful > (returns 1) If it is unsucessful, the data chain is not freed. > Therefore the call to m_free is not needed, and may cause panic > freeing free mbuf. Are we looking at the same code? The m_free is freeing the *header*, not the *data chain*; the reason for moving the call was that &rhp->rh_src (wonder if I remembered that right) is right in the mbuf ``m'', so the m_free must be moved down a bit. That sbappendaddr returns 1 for success and 0 for failure, rathern than 0 for success and -1 (or an error code) for failure, is another matter entirely.... -- (This line accidently left nonblank.) In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland