Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 1997 20:55:08 +0400 (MSD)
From:      bag@sinbin.demos.su
To:        cmott@srv.net (Charles Mott)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: udp and ifconfig alias
Message-ID:  <199710081656.JAA29856@hub.freebsd.org>
In-Reply-To: <Pine.BSF.3.96.971008090659.29502A-100000@darkstar.home> from "Charles Mott" at "Oct 8, 97 09:21:34 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> If I have multiple addresses on the same interface created with ifconfig
> alias, and a process is listening on udp *.7654, when a packet is returned
> after a call to recvfrom(), is it possible to tell which address it was
> sent to?  I have tried calling getsockname(), but my test code doesn't
> seem to be working.  And the more I think about it, getsockname() doesn't
> make sense for a connectionless protocol like UDP.

use recvmsg call, and IP_RECVDSTADDR option enabled (man 4 ip)

   Alex.

> 
> Charles Mott
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710081656.JAA29856>