[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CADHp1Nzgjs5OGXWhs-zy6LZ2wsbspRAc+EW4_J3EsUjOOPCxTA@mail.gmail.com>
Date: Tue, 2 Apr 2013 17:25:58 +0200
From: Teto <mattator@...il.com>
To: netdev@...r.kernel.org
Subject: How to find an available TCP port
Hi,
I would like to do deterministic port-based load balancing, that is
choosing a free port number N so that N % K = X while knowing K and X.
Since I am patching a specific implementation, I would like to check
the availibility of the port without having to check bind() return
value.
I believe the function tcp_lport_inuse ( in this file
http://www.cab.u-szeged.hu/linux/kernel/linux/net/ipv4/tcp.c.html)
does what I wish. I would like to call it from another file but it is
static. So here are my questions:
1st/ Is that the correct function ?
2/ How to use it in another src file ? or do you have any other workaround ?
Sorry if that's too noobish a question, I am not used to kernel
development (yet). I f that's the case redirect me to the proper
mailing list.
Best regards
Matt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists