Project

General

Profile

Actions

Feature #2587

closed

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

Added by dexter over 6 years ago. Updated about 6 years 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

Actions #1

Updated by dexter over 6 years ago

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

Made an experiment to confirm that our idea works.

Actions #2

Updated by dexter over 6 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.

Actions #3

Updated by dexter over 6 years ago

  • % Done changed from 50 to 100

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

Actions #4

Updated by dexter over 6 years ago

  • Tracker changed from Bug to Feature
Actions #5

Updated by dexter over 6 years ago

  • Status changed from In Progress to Resolved
Actions #6

Updated by laforge about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)