Project

General

Profile

Feature #2587

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

Added by dexter over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
10/20/2017
Due date:
% Done:

100%

Spec Reference:

Description

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

History

#1 Updated by dexter over 1 year 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 1 year 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 1 year ago

  • % Done changed from 50 to 100

Patch is up for review: https://gerrit.osmocom.org/4372

#4 Updated by dexter over 1 year ago

  • Tracker changed from Bug to Feature

#5 Updated by dexter over 1 year ago

  • Status changed from In Progress to Resolved

#6 Updated by laforge over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)