Improve port allocation logic for tiny proxy.

Description

Currently, we ask OS to provide free port and pass it to tinyproxy to listen to communication.

We need to handle the following cases

  1. What if OS fails to provide a free port number

  2. Can we predefine port range for tinyproxy usage?

Environment

None

Activity

Antia Puentes 
February 19, 2020 at 11:54 AM

Since WAM does not use tinyproxy anymore ( and ), this issue has become obsolete and we can close it.

Jacobo Aragunde Pérez 
September 27, 2019 at 3:44 PM

The move to token-based security would let us get rid of this component, let's put this on hold.

jose bollo 
September 16, 2019 at 7:50 AM

I agree that asking the OS to allocates the port is the best. How handling error of allocation is the big thing. Refusing to start with a clear error message is the only issue.

AK 
December 11, 2018 at 9:41 AM

There is a similar implementation for allocating a port to af-binder services.

https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/app-framework-main.git;a=commitdiff;h=HEAD;hp=da4db4facb319522df538327fdad866a0f149e15

 

In the current implementation, to get the random port number,  use 0 in a bind then use getsockname to retrieve the allocated port.

Current implementation seems to be better than generating random port number dynamically.

delegating port generation to OS seems to be safest.

  1. It's not pre computed and can not be easily guessed.

  2. OS will handle resource allocation 

  3. OS will handle port conflict resolution 

Won't Fix

Details

Assignee

Reporter

Labels

Contract ID

Priority

Created November 13, 2018 at 9:43 AM
Updated February 19, 2020 at 9:10 PM
Resolved February 19, 2020 at 3:55 PM