Message ID | a4cd1adb-74d4-4eea-9f74-0d0ac3d79e44@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp213022dyb; Thu, 22 Feb 2024 13:12:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqqhRazeiRKw3+4y9UL9MxMlm7igSqH+A4FgQbUn94NbkWsSsyctWrApIS2b4xQ4eYzK7IK0sA/cnIFoUyruQBrZpbdw== X-Google-Smtp-Source: AGHT+IFV9RruXzjvx3dGaN+6p1zqkZ1OZkBhCw/Dbg2vt0MPLRNv3wJmDthXyVMzrycZal5Vb2oo X-Received: by 2002:a17:90a:d790:b0:29a:6cf0:57a3 with SMTP id z16-20020a17090ad79000b0029a6cf057a3mr1360pju.8.1708636375601; Thu, 22 Feb 2024 13:12:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708636375; cv=pass; d=google.com; s=arc-20160816; b=y96MOD5lfbYWjvno90D8X+47rnNozCbkpHYDR+XQTaafqUPx+rxV5Z3x7NTjn953Fr jHoVNPoLD5OIC3OuOM+/ocEZrhlv/GP+9vYlJmCT5no8eZ5Tx/AJUhigap7gODhjPPcn QGwZAlk6oR8/ICokqjln8PJ1IlmJXH1GvcRDd+nvRTShC6co4yCSkWb2Tn2O3nmFykqZ 4Z4C/aNPLki5RMYbk05eOXeeNQtTNm+ZDL945IKrKE+eVkPmaQN+CKJ01IPmIiGPE1uu /rZ/shhjo8hQczFkE5BU0HTdbn/TmgQnWq35+/Wf3SE1XgdwAtICw9YaIqPbLQySv4hT kT5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:to:from:subject :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=guv65Bw2FKNAkGv/Wh3qjRvziyHipb80uH1upaj5asE=; fh=S4EOgbUebAf2Sb08fYbzqQJkGGoP+T1aAbcYdhkQlpQ=; b=Gh3uT64El9Sf+vtuffVvcEDC8qfJfsQlET9Zl3Okx5lki3/Lt5ygCKSnEgKDep+w8e bIKeOhzfnBCQyyqiyKDyRq4htwMXEFeiQKxJtszUJT4p/n35njXW0lXYDoOkW5eDIixc Zvb6xX/lH/tvnH8NIufY15hoA6zHwpvUOSkqg7XloQxbST4EjvxXjTBd2zbs2O7gVCGj ViX15ALnFBgwtfhw/p96gDfIMVAbTgplJ3m/OxnB7XYzg3XR8A82ehuV92lCbLFSdGWH 6wXxRwKTCGt6/V9nPqXEGYWYvCrNzH2t4j6O33Py1Lqkfo2NSeWPs9J2uVgJnyet+JFQ FiyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SEO8GbkQ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id kk13-20020a17090b4a0d00b00299536beb03si4445274pjb.109.2024.02.22.13.12.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:12:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SEO8GbkQ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77338-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 45EA3B254BA for <ouuuleilei@gmail.com>; Thu, 22 Feb 2024 20:51:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B30173F0B; Thu, 22 Feb 2024 20:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SEO8GbkQ" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DAF914B81E; Thu, 22 Feb 2024 20:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708635089; cv=none; b=FDLK24Emtj5WQjIJgNzuvpBHwKjQLMn4ncto9X3SRClHBaiCupCKnhOXNkLaVxa8O3Axdypc6hWyjXntgqoXIQMdzn30ezze6vA8xrRuGRCIUj8ibcvJswGXkbblw8EJLRrHC5mAbTdb8st+tctNexCI/vNtEOlH9BWaJD4ptD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708635089; c=relaxed/simple; bh=b7+uHMUj2gcp+zIE9cIZoMRwuVWLu76/OjKqXpXLskM=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=CSZjqTmPOumCKHSBCM3QW86FreZwJVc0Q7USpGjNY19j+xiO1GP1qyNMul4bzHnoTpHhYj52vIXtsnVHDnV919tqF8W6YjD8wWwO8v5rb3FaQtjYMmJ2+DScqM53jAMJYLZBxXhDx1PwUaWhAxLJAXQ0UUV39GIkgbjrK/SXgpQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SEO8GbkQ; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-41241f64c6bso1433725e9.0; Thu, 22 Feb 2024 12:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708635086; x=1709239886; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:to:from:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=guv65Bw2FKNAkGv/Wh3qjRvziyHipb80uH1upaj5asE=; b=SEO8GbkQjuSEdBpLf/tV39fpiOmeSMi5c19n32c17suUTKsxvziO4cvYptMAc2E8sT ZLkzDv8taGlNBoCu7uBb6+j/68ZVwihrpbet7D+h9FCM8xRC4oTZyVhXFHPqsHjS6T4q 6ccUEi+vLkhA0I5lFEqcx6c5bfuPv0hXkohnstzQFW89bqiFFfCVaNaYh53XThXMnWbf t3StLNEcDF362NfJM0o+wUBKCme8jiymapMcrhIYTjvbhWE/yU9AHws1f0X7jM65C+yw 3W0eMWP1K95oukyWpHMJyzUlFBWwDbPBoYG0aguyDwQ++fpqlBwytDmYSMC2QRe395gj PufA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708635086; x=1709239886; h=content-transfer-encoding:in-reply-to:references:to:from:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=guv65Bw2FKNAkGv/Wh3qjRvziyHipb80uH1upaj5asE=; b=rkEx4hdlc1qtX/oSQ5v+weq9Kr+595ZZp7hE5pLdmGZA4T5aYe2Uka+b9bPkfKb2eT 7OCV3Z4HzNmWrizN0O7YNdHbGmVQYA4dyEx8GerUJ6lFSFT2Xck6R8jGkujjI70ebDzt wnr+tE2BikZBeGrcOeAQ5r32xFbAGbeJca+iwnQ+x/ASObwiAAU4hFRUVdoFpAJ8Q7Ng uHOUGe84ApmwoROF7HcvGOqmcKD1dW9GWs5xcovyoHjgguyamqNSPSnAmYcTPnelt7mY d2ofszX72FomCLwujaDGCCyIKoQVgCi4+rhCLYDpQwxlovfeeJwWGzkvYION3iMf6lKU EeKQ== X-Forwarded-Encrypted: i=1; AJvYcCW7obJseBEHLIfz6h6+Rg60NtfxtaPN+9UNTDx2zwzxt3Y2pi4xmhHX43vT3GgCzmXa4QPG8Pkrd4TxTsjvVPq+CCeTjIn8DDF0hdyTL2YpSYXlsX6JDcL3Ye+mv5MApZmF8hAn X-Gm-Message-State: AOJu0Yw6CmuIRhkBKvEvm3m1ehAaUZREQUplRq0KeJySwatqVRSFz8Ju PCNGuILYI0C3QnAACPxaVZhVaBU/EKiyF2nq05OiDoa0ouOUKr/n X-Received: by 2002:a5d:6108:0:b0:33d:20ca:8415 with SMTP id v8-20020a5d6108000000b0033d20ca8415mr149778wrt.63.1708635085743; Thu, 22 Feb 2024 12:51:25 -0800 (PST) Received: from debian ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id w17-20020adfcd11000000b0033cdbe335bcsm166783wrm.71.2024.02.22.12.51.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Feb 2024 12:51:25 -0800 (PST) Message-ID: <a4cd1adb-74d4-4eea-9f74-0d0ac3d79e44@gmail.com> Date: Thu, 22 Feb 2024 21:51:09 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Subject: [PATCH net-next 1/2] net: vxlan: enable local address bind for vxlan sockets From: Richard Gobert <richardbgobert@gmail.com> To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, idosch@nvidia.com, razor@blackwall.org, amcohen@nvidia.com, petrm@nvidia.com, jbenc@redhat.com, b.galvani@gmail.com, bpoirier@nvidia.com, gavinl@nvidia.com, martin.lau@kernel.org, daniel@iogearbox.net, herbert@gondor.apana.org.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <df300a49-7811-4126-a56a-a77100c8841b@gmail.com> In-Reply-To: <df300a49-7811-4126-a56a-a77100c8841b@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791635096608309784 X-GMAIL-MSGID: 1791635096608309784 |
Series |
net: add local address bind support to vxlan and geneve
|
|
Commit Message
Richard Gobert
Feb. 22, 2024, 8:51 p.m. UTC
This patch adds support for binding to a local address in vxlan sockets.
It achieves this by using vxlan_addr union to represent a local address
to bind to, and copying it to udp_port_cfg in vxlan_create_sock.
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
---
drivers/net/vxlan/vxlan_core.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
Comments
Hi Richard, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Richard-Gobert/net-vxlan-enable-local-address-bind-for-vxlan-sockets/20240223-045600 base: net-next/main patch link: https://lore.kernel.org/r/a4cd1adb-74d4-4eea-9f74-0d0ac3d79e44%40gmail.com patch subject: [PATCH net-next 1/2] net: vxlan: enable local address bind for vxlan sockets config: arc-randconfig-r133-20240223 (https://download.01.org/0day-ci/archive/20240224/202402240119.AR4eT8mt-lkp@intel.com/config) compiler: arc-elf-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240224/202402240119.AR4eT8mt-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402240119.AR4eT8mt-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/net/vxlan/vxlan_core.c: In function 'vxlan_create_sock': >> drivers/net/vxlan/vxlan_core.c:3498:34: error: 'struct udp_port_cfg' has no member named 'local_ip6'; did you mean 'local_ip'? 3498 | memcpy(&udp_conf.local_ip6.s6_addr32, | ^~~~~~~~~ | local_ip vim +3498 drivers/net/vxlan/vxlan_core.c 3482 3483 static struct socket *vxlan_create_sock(struct net *net, bool ipv6, __be16 port, 3484 u32 flags, int ifindex, 3485 union vxlan_addr addr) 3486 { 3487 struct socket *sock; 3488 struct udp_port_cfg udp_conf; 3489 int err; 3490 3491 memset(&udp_conf, 0, sizeof(udp_conf)); 3492 3493 if (ipv6) { 3494 udp_conf.family = AF_INET6; 3495 udp_conf.use_udp6_rx_checksums = 3496 !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX); 3497 udp_conf.ipv6_v6only = 1; > 3498 memcpy(&udp_conf.local_ip6.s6_addr32, 3499 &addr.sin6.sin6_addr.s6_addr32, 3500 sizeof(addr.sin6.sin6_addr.s6_addr32)); 3501 } else { 3502 udp_conf.family = AF_INET; 3503 udp_conf.local_ip.s_addr = addr.sin.sin_addr.s_addr; 3504 memcpy(&udp_conf.local_ip.s_addr, 3505 &addr.sin.sin_addr.s_addr, 3506 sizeof(addr.sin.sin_addr.s_addr)); 3507 } 3508 3509 udp_conf.local_udp_port = port; 3510 udp_conf.bind_ifindex = ifindex; 3511 3512 /* Open UDP socket */ 3513 err = udp_sock_create(net, &udp_conf, &sock); 3514 if (err < 0) 3515 return ERR_PTR(err); 3516 3517 udp_allow_gso(sock->sk); 3518 return sock; 3519 } 3520
Hi Richard, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Richard-Gobert/net-vxlan-enable-local-address-bind-for-vxlan-sockets/20240223-045600 base: net-next/main patch link: https://lore.kernel.org/r/a4cd1adb-74d4-4eea-9f74-0d0ac3d79e44%40gmail.com patch subject: [PATCH net-next 1/2] net: vxlan: enable local address bind for vxlan sockets config: x86_64-randconfig-122-20240224 (https://download.01.org/0day-ci/archive/20240224/202402241309.eGUSV2aI-lkp@intel.com/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240224/202402241309.eGUSV2aI-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402241309.eGUSV2aI-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/net/vxlan/vxlan_core.c:3498:20: error: no member named 'local_ip6' in 'struct udp_port_cfg' 3498 | memcpy(&udp_conf.local_ip6.s6_addr32, | ~~~~~~~~ ^ include/linux/fortify-string.h:639:17: note: expanded from macro 'memcpy' 639 | __struct_size(p), __struct_size(q), \ | ^ include/linux/compiler_types.h:358:56: note: expanded from macro '__struct_size' 358 | #define __struct_size(p) __builtin_dynamic_object_size(p, 0) | ^ include/linux/fortify-string.h:582:27: note: expanded from macro '__fortify_memcpy_chk' 582 | const size_t __p_size = (p_size); \ | ^~~~~~ >> drivers/net/vxlan/vxlan_core.c:3498:20: error: no member named 'local_ip6' in 'struct udp_port_cfg' 3498 | memcpy(&udp_conf.local_ip6.s6_addr32, | ~~~~~~~~ ^ include/linux/fortify-string.h:640:17: note: expanded from macro 'memcpy' 640 | __member_size(p), __member_size(q), \ | ^ include/linux/compiler_types.h:359:56: note: expanded from macro '__member_size' 359 | #define __member_size(p) __builtin_dynamic_object_size(p, 1) | ^ include/linux/fortify-string.h:584:33: note: expanded from macro '__fortify_memcpy_chk' 584 | const size_t __p_size_field = (p_size_field); \ | ^~~~~~~~~~~~ >> drivers/net/vxlan/vxlan_core.c:3498:20: error: no member named 'local_ip6' in 'struct udp_port_cfg' 3498 | memcpy(&udp_conf.local_ip6.s6_addr32, | ~~~~~~~~ ^ include/linux/fortify-string.h:638:47: note: expanded from macro 'memcpy' 638 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^ include/linux/fortify-string.h:593:20: note: expanded from macro '__fortify_memcpy_chk' 593 | __underlying_##op(p, q, __fortify_size); \ | ^ 3 errors generated. vim +3498 drivers/net/vxlan/vxlan_core.c 3482 3483 static struct socket *vxlan_create_sock(struct net *net, bool ipv6, __be16 port, 3484 u32 flags, int ifindex, 3485 union vxlan_addr addr) 3486 { 3487 struct socket *sock; 3488 struct udp_port_cfg udp_conf; 3489 int err; 3490 3491 memset(&udp_conf, 0, sizeof(udp_conf)); 3492 3493 if (ipv6) { 3494 udp_conf.family = AF_INET6; 3495 udp_conf.use_udp6_rx_checksums = 3496 !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX); 3497 udp_conf.ipv6_v6only = 1; > 3498 memcpy(&udp_conf.local_ip6.s6_addr32, 3499 &addr.sin6.sin6_addr.s6_addr32, 3500 sizeof(addr.sin6.sin6_addr.s6_addr32)); 3501 } else { 3502 udp_conf.family = AF_INET; 3503 udp_conf.local_ip.s_addr = addr.sin.sin_addr.s_addr; 3504 memcpy(&udp_conf.local_ip.s_addr, 3505 &addr.sin.sin_addr.s_addr, 3506 sizeof(addr.sin.sin_addr.s_addr)); 3507 } 3508 3509 udp_conf.local_udp_port = port; 3510 udp_conf.bind_ifindex = ifindex; 3511 3512 /* Open UDP socket */ 3513 err = udp_sock_create(net, &udp_conf, &sock); 3514 if (err < 0) 3515 return ERR_PTR(err); 3516 3517 udp_allow_gso(sock->sk); 3518 return sock; 3519 } 3520
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 16106e088c63..b5f3f946ebcd 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -3479,8 +3479,9 @@ static const struct ethtool_ops vxlan_ethtool_ops = { .get_link_ksettings = vxlan_get_link_ksettings, }; -static struct socket *vxlan_create_sock(struct net *net, bool ipv6, - __be16 port, u32 flags, int ifindex) +static struct socket *vxlan_create_sock(struct net *net, bool ipv6, __be16 port, + u32 flags, int ifindex, + union vxlan_addr addr) { struct socket *sock; struct udp_port_cfg udp_conf; @@ -3493,8 +3494,15 @@ static struct socket *vxlan_create_sock(struct net *net, bool ipv6, udp_conf.use_udp6_rx_checksums = !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX); udp_conf.ipv6_v6only = 1; + memcpy(&udp_conf.local_ip6.s6_addr32, + &addr.sin6.sin6_addr.s6_addr32, + sizeof(addr.sin6.sin6_addr.s6_addr32)); } else { udp_conf.family = AF_INET; + udp_conf.local_ip.s_addr = addr.sin.sin_addr.s_addr; + memcpy(&udp_conf.local_ip.s_addr, + &addr.sin.sin_addr.s_addr, + sizeof(addr.sin.sin_addr.s_addr)); } udp_conf.local_udp_port = port; @@ -3512,7 +3520,8 @@ static struct socket *vxlan_create_sock(struct net *net, bool ipv6, /* Create new listen socket if needed */ static struct vxlan_sock *vxlan_socket_create(struct net *net, bool ipv6, __be16 port, u32 flags, - int ifindex) + int ifindex, + union vxlan_addr addr) { struct vxlan_net *vn = net_generic(net, vxlan_net_id); struct vxlan_sock *vs; @@ -3527,7 +3536,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, bool ipv6, for (h = 0; h < VNI_HASH_SIZE; ++h) INIT_HLIST_HEAD(&vs->vni_list[h]); - sock = vxlan_create_sock(net, ipv6, port, flags, ifindex); + sock = vxlan_create_sock(net, ipv6, port, flags, ifindex, addr); if (IS_ERR(sock)) { kfree(vs); return ERR_CAST(sock); @@ -3591,7 +3600,7 @@ static int __vxlan_sock_add(struct vxlan_dev *vxlan, bool ipv6) if (!vs) vs = vxlan_socket_create(vxlan->net, ipv6, vxlan->cfg.dst_port, vxlan->cfg.flags, - l3mdev_index); + l3mdev_index, vxlan->cfg.saddr); if (IS_ERR(vs)) return PTR_ERR(vs); #if IS_ENABLED(CONFIG_IPV6)