Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1300937rwi; Thu, 27 Oct 2022 14:02:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6iJ7O09PwNjS4mAANJMi0jcTC6Dn5v9kU2j8GGbUo7KZrp/6hPqiXQBtdsRUc4Py7yjvYE X-Received: by 2002:a05:6402:1d4e:b0:461:c7bd:7d9c with SMTP id dz14-20020a0564021d4e00b00461c7bd7d9cmr20926868edb.284.1666904538989; Thu, 27 Oct 2022 14:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666904538; cv=none; d=google.com; s=arc-20160816; b=A9liAHzjRyvvkneoYgwZHWxeu3pMs+4K5+co+JqbU8bkbnvNFU+VkFtUrltzoxnu/+ /Z/6uoVYk2oUHB4kQK0osTH3IOEvgMqFShN7Q5+BxpmmwLjHyU967RexDT1DdyL6KAyb XOViwQC1IDERvFvoEZJSN6+cK8KaI3FckfeGU7SZm3eUpQt/+b2oHbGup7avhxjvTRqj DOx5TRgraC9S/YxywVwBRIL2X0Dtmyq5UuaV1ymPDnfwx3g16NHDLuEZLo245hUeU6VP 4r2UJF8rvV7JZwV40cb8RqrxrE3O4gpnvbMddL3PGinGNNa0i5tAk9Yf+J2aYToIHTxS bXLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+hdisk2huNybtWVXbtT77JtWTDX9XIc08M/YyYNQqQA=; b=BVHV8W5TYkW0V8JkDSJHICkPuTi/U6sOcSni1zLM/07/CDdyXSz42v0OjnAVhZLw9E klIwTygSo0k+kckTYbR5J4cRXFddOECNfZB7IVp5k8GfsPcPQXm2LtGULRsGBx5MjGjK 788BTIgiHHlU+KPszhrsePCy84r8Tldr2OvScgUSavAv4TBfhTSlVhgKU5W1v0gMe8RI +YYfsDtifvzX/H/QMt9A5ryQllo4z87IKvwqKp+Yf7H6X4+Wjz120smqD0kAcKB2De8O IlJV82xxXVVve8SGLTcgFEy6xrwoBrtSvHb5ChUx3eOcX2bYFTM6ISEm4Z4T8/nrP9Fb GFFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=MM8otwdC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gh30-20020a1709073c1e00b00787b0b0a96esi1846027ejc.131.2022.10.27.14.01.46; Thu, 27 Oct 2022 14:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=MM8otwdC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235869AbiJ0Uyr (ORCPT + 99 others); Thu, 27 Oct 2022 16:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237162AbiJ0Uwb (ORCPT ); Thu, 27 Oct 2022 16:52:31 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 600C697EDA for ; Thu, 27 Oct 2022 13:45:31 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id bh7-20020a05600c3d0700b003c6fb3b2052so2123895wmb.2 for ; Thu, 27 Oct 2022 13:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+hdisk2huNybtWVXbtT77JtWTDX9XIc08M/YyYNQqQA=; b=MM8otwdC1LN6OlvEG3BsuhkUbKyfXU0Gw9ltqT8j5DlmSOuwH3akRiMcBkqr1LxZwv WVkTGPBIPKvb9LLxgN5dpr3kAxslA7vmqoVRPfb6BYsG3k+xHpVlqtEJ96EPIkbZ7obO aaang8AdmLd0ddkxrre13QxJyh97ceo38siZ6S4NNk/BSva1bMi/PwXklRVNOAHva9Ob FCJD5ODwXDWGUJuF3rNTCeWGDx4+yhI3cD6eN2cpsFBT6ZuxRYUQI54faEnwKvHgGr17 j5f+8d0Jti2Vga93K4Q1CrOXVrtZro8+lNuJ0oD+pUHZWrWuQ7Ty03k5B3yR+DOOiVS2 2IMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+hdisk2huNybtWVXbtT77JtWTDX9XIc08M/YyYNQqQA=; b=iZ67ZepQneT2E5lbsXqVEb93dxzD9MJ1dF1B4TCWo+z64wY1kDrAbDys4znv4OSz7T wB03bTBCw9zV+BlRpmV8lc00qu3IkuXQbmnvgBP7nfNXmuZU0V9Qk15C9qhACSczKvGP Tji+efsfFaJ7vs9CCffSLmyD92T7UcnCpr7Hhj5PnqYFieqkXp2zYbeVw0NF7v99Hudm kklDxwRcE8KjJM0U1M3scwCQ4Mno75cjZq6OexWhLEGgYXlTRr0L3fcEBoxsnAisFfP5 E0Bu4N/T81B11YQ14HF/EODN3vq+UTWtsm49W7Xkbf7Su7EC8EcuG0XhqO+ht5DuM3EU RteA== X-Gm-Message-State: ACrzQf2iX/pyvTTfmQSLbBlKvock1LuVyt1Bz2bWgHQeyhxebHrq795B 6Kd1y1Yp1pcbAsye/7Imqc2bcw== X-Received: by 2002:a05:600c:19d2:b0:3c6:fbb9:ca9a with SMTP id u18-20020a05600c19d200b003c6fbb9ca9amr7330350wmq.110.1666903486720; Thu, 27 Oct 2022 13:44:46 -0700 (PDT) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id n3-20020a5d6b83000000b00236644228besm1968739wrx.40.2022.10.27.13.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 13:44:46 -0700 (PDT) From: Dmitry Safonov To: linux-kernel@vger.kernel.org, David Ahern , Eric Dumazet Cc: Dmitry Safonov , Andy Lutomirski , Ard Biesheuvel , Bob Gilligan , Dan Carpenter , "David S. Miller" , Dmitry Safonov <0x7f454c46@gmail.com>, Eric Biggers , "Eric W. Biederman" , Francesco Ruggeri , Herbert Xu , Hideaki YOSHIFUJI , Ivan Delalande , Jakub Kicinski , Leonard Crestez , Paolo Abeni , Salam Noureddine , Shuah Khan , netdev@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH v3 34/36] selftest/nettest: Rename md5_prefix* => auth_prefix* Date: Thu, 27 Oct 2022 21:43:45 +0100 Message-Id: <20221027204347.529913-35-dima@arista.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027204347.529913-1-dima@arista.com> References: <20221027204347.529913-1-dima@arista.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Now it's going to be used for TCP-AO testing too. Signed-off-by: Dmitry Safonov --- tools/testing/selftests/net/nettest.c | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/net/nettest.c b/tools/testing/selftests/net/nettest.c index b9e600899cf6..3499d6aff9e4 100644 --- a/tools/testing/selftests/net/nettest.c +++ b/tools/testing/selftests/net/nettest.c @@ -97,11 +97,11 @@ struct sock_args { const char *password; /* prefix for MD5 password */ - const char *md5_prefix_str; + const char *auth_prefix_str; union { struct sockaddr_in v4; struct sockaddr_in6 v6; - } md5_prefix; + } auth_prefix; unsigned int prefix_len; /* 0: default, -1: force off, +1: force on */ int bind_key_ifindex; @@ -274,7 +274,7 @@ static int tcp_md5sig(int sd, void *addr, socklen_t alen, struct sock_args *args md5sig.tcpm_flags |= TCP_MD5SIG_FLAG_PREFIX; md5sig.tcpm_prefixlen = args->prefix_len; - addr = &args->md5_prefix; + addr = &args->auth_prefix; } memcpy(&md5sig.tcpm_addr, addr, alen); @@ -314,13 +314,13 @@ static int tcp_md5_remote(int sd, struct sock_args *args) switch (args->version) { case AF_INET: sin.sin_port = htons(args->port); - sin.sin_addr = args->md5_prefix.v4.sin_addr; + sin.sin_addr = args->auth_prefix.v4.sin_addr; addr = &sin; alen = sizeof(sin); break; case AF_INET6: sin6.sin6_port = htons(args->port); - sin6.sin6_addr = args->md5_prefix.v6.sin6_addr; + sin6.sin6_addr = args->auth_prefix.v6.sin6_addr; addr = &sin6; alen = sizeof(sin6); break; @@ -753,11 +753,11 @@ static int convert_addr(struct sock_args *args, const char *_str, case ADDR_TYPE_MD5_PREFIX: desc = "md5 prefix"; if (family == AF_INET) { - args->md5_prefix.v4.sin_family = AF_INET; - addr = &args->md5_prefix.v4.sin_addr; + args->auth_prefix.v4.sin_family = AF_INET; + addr = &args->auth_prefix.v4.sin_addr; } else if (family == AF_INET6) { - args->md5_prefix.v6.sin6_family = AF_INET6; - addr = &args->md5_prefix.v6.sin6_addr; + args->auth_prefix.v6.sin6_family = AF_INET6; + addr = &args->auth_prefix.v6.sin6_addr; } else return 1; @@ -840,8 +840,8 @@ static int validate_addresses(struct sock_args *args) convert_addr(args, args->remote_addr_str, ADDR_TYPE_REMOTE) < 0) return 1; - if (args->md5_prefix_str && - convert_addr(args, args->md5_prefix_str, + if (args->auth_prefix_str && + convert_addr(args, args->auth_prefix_str, ADDR_TYPE_MD5_PREFIX) < 0) return 1; @@ -2029,7 +2029,7 @@ int main(int argc, char *argv[]) args.password = optarg; break; case 'm': - args.md5_prefix_str = optarg; + args.auth_prefix_str = optarg; break; case 'S': args.use_setsockopt = 1; @@ -2091,13 +2091,13 @@ int main(int argc, char *argv[]) } if (args.password && (!args.use_md5 || - (!args.has_remote_ip && !args.md5_prefix_str) || + (!args.has_remote_ip && !args.auth_prefix_str) || args.type != SOCK_STREAM)) { log_error("MD5 passwords apply to TCP only and require a remote ip for the password\n"); return 1; } - if ((args.md5_prefix_str || args.use_md5) && !args.password) { + if ((args.auth_prefix_str || args.use_md5) && !args.password) { log_error("Prefix range for MD5 protection specified without a password\n"); return 1; } -- 2.38.1