Add full VNET support to the inet_get_local_port_range() function in
the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
303bd80ad5
commit
82d0140707
@ -43,10 +43,11 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_pcb.h>
|
||||
|
||||
static inline void inet_get_local_port_range(int *low, int *high)
|
||||
static inline void
|
||||
inet_get_local_port_range(struct vnet *vnet, int *low, int *high)
|
||||
{
|
||||
#ifdef INET
|
||||
CURVNET_SET_QUIET(TD_TO_VNET(curthread));
|
||||
CURVNET_SET_QUIET(vnet);
|
||||
*low = V_ipport_firstauto;
|
||||
*high = V_ipport_lastauto;
|
||||
CURVNET_RESTORE();
|
||||
|
@ -2503,7 +2503,7 @@ static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
|
||||
int low, high, remaining;
|
||||
unsigned int rover;
|
||||
|
||||
inet_get_local_port_range(&low, &high);
|
||||
inet_get_local_port_range(&init_net, &low, &high);
|
||||
remaining = (high - low) + 1;
|
||||
rover = random() % remaining + low;
|
||||
retry:
|
||||
|
Loading…
x
Reference in New Issue
Block a user