LINBIT / csync2

file synchronization tool using librsync and current state databases
GNU General Public License v2.0
145 stars 39 forks source link

Using secondary IP address #33

Open liangxin1300 opened 3 years ago

liangxin1300 commented 3 years ago

Hi @lge ,

I meet an environment,

On node1,

# ip a
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:e8:7f:24 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.121/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 10.10.10.191/24 brd 10.10.10.255 scope global secondary eth1
       valid_lft forever preferred_lft forever
# hostname
node1
# cat /etc/hosts
10.10.10.191 node1
10.10.10.192 node2
10.10.10.121 vnode1
10.10.10.122 vnode2

On node2,

# ip a
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:39:4a:c2 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.122/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 10.10.10.192/24 brd 10.10.10.255 scope global secondary eth1
       valid_lft forever preferred_lft forever
# hostname
node2
# cat /etc/hosts
10.10.10.191 node1
10.10.10.192 node2
10.10.10.121 vnode1
10.10.10.122 vnode2

Problem:

When verify_peername, node1 raise Identification failed!, since node2's address get from getaddrinfo is 10.10.10.192, while "peername" get from getpeername is 10.10.10.122(although node2 using 10.10.10.192 to connect with node1), so here is the difference to make verify_peername failed

Any suggestions about this?

Thank you!