Simon Horman says:

====================
Second Round of IPVS Fixes for v4.7

The fix from Quentin Armitage allows the backup sync daemon to
be bound to a link-local mcast IPv6 address as is already the case
for IPv4.
====================

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Pablo Neira Ayuso 2016-07-11 11:55:16 +02:00
commit 4edfa9d0bf
1 changed files with 4 additions and 2 deletions

View File

@ -1545,7 +1545,8 @@ static struct socket *make_send_sock(struct netns_ipvs *ipvs, int id)
/* /*
* Set up receiving multicast socket over UDP * Set up receiving multicast socket over UDP
*/ */
static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id) static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id,
int ifindex)
{ {
/* multicast addr */ /* multicast addr */
union ipvs_sockaddr mcast_addr; union ipvs_sockaddr mcast_addr;
@ -1566,6 +1567,7 @@ static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id)
set_sock_size(sock->sk, 0, result); set_sock_size(sock->sk, 0, result);
get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->bcfg, id); get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->bcfg, id);
sock->sk->sk_bound_dev_if = ifindex;
result = sock->ops->bind(sock, (struct sockaddr *)&mcast_addr, salen); result = sock->ops->bind(sock, (struct sockaddr *)&mcast_addr, salen);
if (result < 0) { if (result < 0) {
pr_err("Error binding to the multicast addr\n"); pr_err("Error binding to the multicast addr\n");
@ -1868,7 +1870,7 @@ int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *c,
if (state == IP_VS_STATE_MASTER) if (state == IP_VS_STATE_MASTER)
sock = make_send_sock(ipvs, id); sock = make_send_sock(ipvs, id);
else else
sock = make_receive_sock(ipvs, id); sock = make_receive_sock(ipvs, id, dev->ifindex);
if (IS_ERR(sock)) { if (IS_ERR(sock)) {
result = PTR_ERR(sock); result = PTR_ERR(sock);
goto outtinfo; goto outtinfo;