Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1598158

[PATCH net-next 1/3] vxlan: don't allow link-local IPv6 local/remote addresses without interface

From Matthias Schiffer <mschiffer@universe-factory.net>
Newsgroups linux.kernel
Subject [PATCH net-next 1/3] vxlan: don't allow link-local IPv6 local/remote addresses without interface
Date 2017-03-11 00:00 +0100
Message-ID <tjBFT-25r-11@gated-at.bofh.it> (permalink)
References <tjBwd-1Z5-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 drivers/net/vxlan.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index e375560cc74e..cc0ace73d02e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2922,6 +2922,18 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
 		pr_info("multicast destination requires interface to be specified\n");
 		return -EINVAL;
 	}
+#if IS_ENABLED(CONFIG_IPV6)
+	else if (!conf->remote_ifindex &&
+		 ((conf->saddr.sa.sa_family == AF_INET6 &&
+		  (ipv6_addr_type(&conf->saddr.sin6.sin6_addr) &
+		   IPV6_ADDR_LINKLOCAL)) ||
+		  (dst->remote_ip.sa.sa_family == AF_INET6 &&
+		   (ipv6_addr_type(&dst->remote_ip.sin6.sin6_addr) &
+		    IPV6_ADDR_LINKLOCAL)))) {
+		pr_info("link-local local/remote addresses require interface to be specified\n");
+		return -EINVAL;
+	}
+#endif
 
 	if (conf->mtu) {
 		int max_mtu = ETH_MAX_MTU;
-- 
2.12.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/3] VXLAN over IPv6 link-local Matthias Schiffer <mschiffer@universe-factory.net> - 2017-03-10 23:50 +0100
  [PATCH net-next 2/3] vxlan: fix snooping for link-local IPv6 addresses Matthias Schiffer <mschiffer@universe-factory.net> - 2017-03-11 00:00 +0100
  [PATCH net-next 3/3] vxlan: allow multiple VXLANs with same VNI for IPv6 link-local addresses Matthias Schiffer <mschiffer@universe-factory.net> - 2017-03-11 00:00 +0100
  [PATCH net-next 1/3] vxlan: don't allow link-local IPv6 local/remote addresses without interface Matthias Schiffer <mschiffer@universe-factory.net> - 2017-03-11 00:00 +0100

csiph-web