Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Nov 2000 21:47:50 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        freebsd-net@freebsd.org
Subject:   setting source address for UDP packets
Message-ID:  <20001107214749.A2125@forge.local>

next in thread | raw e-mail | index | archive | help
Hi,

is there any way to set the source address of an UDP (over IPv4) packet
without using bind() or changing the socket state, ala the IN6_PKTINFO
ancillary data to sendmsg?
Background: in a multithreaded server, I want to answer with the source
address the query went to. This will work normally, but if the packet
leaves through another interface than that it arrived on, it will
off course get a different source address. There are some routing
situations where such things can happen. I cannot use bind(),
because the socket is shared by other threads. I could of course lock
the socket in some way, but since the send()-call can block, this
is suboptimal.

Any ideas?

Thanks in advance,
Thomas


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




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