]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
ipvs: fix bind to link-local mcast IPv6 address in backup
authorQuentin Armitage <quentin@armitage.org.uk>
Thu, 16 Jun 2016 07:00:14 +0000 (08:00 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:06:55 +0000 (08:06 -0500)
commit654f7d67474d2e6323692d08ba3708f8f35baa4f
treef532098094a5d5044b595f1df989cde677026ecc
parentf3107ec23cc67ce0902bb93e3c988b2cb92f0ffd
ipvs: fix bind to link-local mcast IPv6 address in backup

BugLink: http://bugs.launchpad.net/bugs/1631468
commit 3777ed688fba82d0bd43f9fc1ebbc6abe788576d upstream.

When using HEAD from
https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/,
the command:
ipvsadm --start-daemon backup --mcast-interface eth0.60 \
    --mcast-group ff02::1:81
fails with the error message:
Argument list too long

whereas both:
ipvsadm --start-daemon master --mcast-interface eth0.60 \
    --mcast-group ff02::1:81
and:
ipvsadm --start-daemon backup --mcast-interface eth0.60 \
    --mcast-group 224.0.0.81
are successful.

The error message "Argument list too long" isn't helpful. The error occurs
because an IPv6 address is given in backup mode.

The error is in make_receive_sock() in net/netfilter/ipvs/ip_vs_sync.c,
since it fails to set the interface on the address or the socket before
calling inet6_bind() (via sock->ops->bind), where the test
'if (!sk->sk_bound_dev_if)' failed.

Setting sock->sk->sk_bound_dev_if on the socket before calling
inet6_bind() resolves the issue.

Fixes: d33288172e72 ("ipvs: add more mcast parameters for the sync daemon")
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/netfilter/ipvs/ip_vs_sync.c