Feature #2587

helper function to finde the right interface for a remote IP-Address

Added by dexter over 3 years ago. Updated almost 3 years ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


In some cases (mgcp-gw) it is important to know the IP-Address of the interface through which a remote IP-Address is reachable. This can be done using the syscalls connect() and getsockname(). Implement a helper function in socket.c that takes a remote ip-address as input and outputs the coresponding local interface


#1 Updated by dexter over 3 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

Made an experiment to confirm that our idea works.

#2 Updated by dexter over 3 years ago

As a sidenote:

The idea is to connect (but not bind) a socket. With the connect syscall, the
kernel will make the actual decision which local interface is appropiate in
order to reach the remote address. We can then query the address of the local
interface choosen using getsockname().

The actual problem we try to solve with this is in the MGCP domain. An MGCP_GW,
that has to serves connections on two different interfaces must return the
ip addres of the interface where the remote reach it to send RTP packets. In
order to know which IP to return, we must probe with the remote IP we already
know thorugh the CRCX or MDCX. The kernel has the routing information of all
interfaces and can make the decision for us.

#3 Updated by dexter over 3 years ago

  • % Done changed from 50 to 100

Patch is up for review:

#4 Updated by dexter over 3 years ago

  • Tracker changed from Bug to Feature

#5 Updated by dexter about 3 years ago

  • Status changed from In Progress to Resolved

#6 Updated by laforge almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)