From owner-freebsd-hackers Wed Oct 8 09:56:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA29873 for hackers-outgoing; Wed, 8 Oct 1997 09:56:49 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from sinbin.demos.su (sinbin.demos.su [194.87.0.31]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id JAA29856 for ; Wed, 8 Oct 1997 09:56:41 -0700 (PDT) (envelope-from bag@sinbin.demos.su) From: bag@sinbin.demos.su Message-Id: <199710081656.JAA29856@hub.freebsd.org> Received: (from bag@localhost) by sinbin.demos.su (8.6.12/) id UAA19635; Wed, 8 Oct 1997 20:55:08 +0400 Posted-Date: Wed, 8 Oct 1997 20:55:08 +0400 Subject: Re: udp and ifconfig alias In-Reply-To: from "Charles Mott" at "Oct 8, 97 09:21:34 am" X-ELM-OSV: (Our standard violations) no-mime=1; no-hdr-encoding=1 To: cmott@srv.net (Charles Mott) Date: Wed, 8 Oct 1997 20:55:08 +0400 (MSD) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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 > >