Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Mar 2002 02:45:05 +0000
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Sergey Babkin <sergey@caldera.com>
Cc:        arch@freebsd.org, chawla@caldera.com
Subject:   Re: proposition for new socket syscalls {send,recv}fromto 
Message-ID:   <200203020245.aa34899@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Fri, 01 Mar 2002 18:10:56 EST." <3C800A80.96CEA9D2@caldera.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <3C800A80.96CEA9D2@caldera.com>, Sergey Babkin writes:
>
>The fix in short: the server should do a bind() to the right address
>before doing the reply. However in practice this code gets much more
>compilcated and ugly, as will be discussed further.

Linux has an IP_PKTINFO socket option and IP_PKTINFO control message
that (I think) allows you record the destination IP on incoming
datagrams and set the source address on outgoing ones. A quick,
minimally tested sample program which uses it is at:

	http://www.maths.tcd.ie/~iedowse/FreeBSD/pktinfo.c

In FreeBSD, we only seem to have this capability for IPv6, using
the IPV6_PKTINFO option and control messages. Implementations of
either an IP_PKTINFO or an IP_SENDSRCADDR control message have been
discussed on freebsd-net a few times, but nothing has been committed
yet.

For systems that have such a mechanism, the proposed syscalls could
just be implemented as library functions instead.

Ian

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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