]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: support binding to specific ip address when activating UDP bearer
authorHoang Le <hoang.h.le@dektech.com.au>
Thu, 11 Oct 2018 01:43:08 +0000 (08:43 +0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 04:56:56 +0000 (21:56 -0700)
commit567f3e4f472a55b6c6c0e7fea3e5cfc5d237a6bb
tree5147882333c6af295ec14678704799e64a55fc0a
parent1f46885904cd77ff2df4d1c97a69121149671e24
tipc: support binding to specific ip address when activating UDP bearer

INADDR_ANY is hard-coded when activating UDP bearer. So, we could not
bind to a specific IP address even with replicast mode using - given
remote ip address instead of using multicast ip address.

In this commit, we fixed it by checking and switch to use appropriate
local ip address.

before:
$netstat -plu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address
udp        0      0 **0.0.0.0:6118**            0.0.0.0:*

after:
$netstat -plu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address
udp        0      0 **10.0.0.2:6118**           0.0.0.0:*

Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/udp_media.c