[Ns-bugs] [Bug 742] New: Implementation of SO_BINDTODEVICE
code at nsnam.ece.gatech.edu
Tue Nov 17 07:08:03 PST 2009
Summary: Implementation of SO_BINDTODEVICE
AssignedTo: ns-bugs at isi.edu
ReportedBy: zarhan at cc.hut.fi
CC: tomh at tomh.org
Estimated Hours: 0.0
Created an attachment (id=657)
Patch to allow bindsockopts
As per discussion at
Here's first draft version of getting SO_BINDTODEVICE to work. It currently
works only on UDP sockets, and only on sending side.
TODO: Receiving side
However, while patch is not that complicated, it affects lots of files, as it
changes the so far pretty unused uint32_t oif in RouteOutput to Ptr<NetDevice>
instead - and as a consequence, every inherited routing protocol and all
methods that have called RouteOutput in it's previous format.
For now, Static and Global Routing protocols actually utilize the new oif
information. Thus, the provided example works, but right now socket doesn't
check if arrived packet came in on right interface. As it stands, the patch
shouldn't BREAK anything, it's just that the added functionality isn't yet
Since there's a lot of changes throughout the tree (node, internet-stack and
routing), I'm hoping that this can be merged relatively quickly so I don't have
to keep recreating the diffs against newer snapshots of ns-3-dev...
The beef is in socket.cc where two methods have been added for binding a device
and checking the value. You can release the binding by binding to zero. Example
illustrates the workings quite well.
CCing Tom due to him participating in the thread on mailing list.
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs