aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2016-09-02 07:37:11 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-04 14:42:56 -0400
commit9b4cdd516dadc1b68c55ba24520194a06adff10c (patch)
tree3b5d45d447a0609276f7143d1eb0b9d2649e2764
parent24b27fc4cdf9e10c5e79e5923b6b7c2c5c95096c (diff)
vxlan: reject multicast destination without an interface
Currently, kernel accepts configurations such as: ip l a type vxlan dstport 4789 id 1 group 239.192.0.1 ip l a type vxlan dstport 4789 id 1 group ff0e::110 However, neither of those really works. In the IPv4 case, the interface cannot be brought up ("RTNETLINK answers: No such device"). This is because multicast join will be rejected without the interface being specified. In the IPv6 case, multicast wil be joined on the first interface found. This is not what the user wants as it depends on random factors (order of interfaces). Note that it's possible to add a local address but it doesn't solve anything. For IPv4, it's not considered in the multicast join (thus the same error as above is returned on ifup). This could be added but it wouldn't help for IPv6 anyway. For IPv6, we do need the interface. Just reject a configuration that sets multicast address and does not provide an interface. Nobody can depend on the previous behavior as it never worked. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxlan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index c0dda6fc0921..6358e35d74b7 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2842,6 +2842,9 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
2842 dev->mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM); 2842 dev->mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
2843 2843
2844 needed_headroom = lowerdev->hard_header_len; 2844 needed_headroom = lowerdev->hard_header_len;
2845 } else if (vxlan_addr_multicast(&dst->remote_ip)) {
2846 pr_info("multicast destination requires interface to be specified\n");
2847 return -EINVAL;
2845 } 2848 }
2846 2849
2847 if (conf->mtu) { 2850 if (conf->mtu) {