Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7906321rwp; Wed, 19 Jul 2023 02:04:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+XumaH23P0YYhok4ptlhNeIwyvBxRxCi0/o0uirxSvFMz6Prg3dQjidgiMzaHaY8qZps3 X-Received: by 2002:a05:6a20:42a7:b0:137:3b34:93d8 with SMTP id o39-20020a056a2042a700b001373b3493d8mr1197210pzj.25.1689757459093; Wed, 19 Jul 2023 02:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689757459; cv=none; d=google.com; s=arc-20160816; b=Yll+seaeM8xDFpqihIKnDvHz9v60m3gVL9Gsk4k1LxKps/TRLHerX0EeytnP1b4Ia+ z8swny4iGnoNMDQHbSMatJoyDL19X9L6wGmJZzUhla7u3LVKLdMyMxHmHlUohvgPE098 as81vbue0XjGpQqc/BdohG+RR41/QThsc16nJvp6DSq1TBi5EQLkYtpltZJLh/2nQt6l QvSKh/WQb4FwlpPuz9P1OcywBsedtvbnnpdrFgSOa5hXN/sbWFjkWrmEKPyMxaiDHHL+ /0BPilho0TkChyjECTQlO0fdJ4cVtPnIVl2WD7UsREZ2XlUFa3ATPzEtbbEQqOMcoEki 92QA== 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 :message-id:date:subject:cc:to:from; bh=RT28KMZUfUxLqE36E2WVSHWEOsxWuK8+5KaakQzM+v8=; fh=OR4cR2J/XhWIWWc5u7cVcCqJLSoaLxx16PAffL72jF4=; b=F6d3sV56JHJBuRB6Ig+F16BscfMYJgz4qINuSonDO0wNOqGxoQRqvFIqgMpKp8ms/k KWf3j4bSBvKW77f9Gysp051q23hhbLx/zuRSp5BM9PRBwmYQ/xBalNMNdi2HtlKNuo/Q UVqo8VZXcN3o1NfQ+coy/uxVDKyj2syyxlJOI+MmeFpYvdk3EIp0B4aizy9MbjPTAD1R 5oqjnfOgMlgz90E+yHOqTydDc/u6mx0KiN3t99qjezQYWrJ62xFqPwIg4FKhygMWJ76w 6VLaMoupQ+obnQBt1Y8VclFY4WEmHdy1m/fw6k7qD9VEV0wOM8s8mQBifuMsEpKl6FJo OihA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a056a00124900b00625559a78a2si3181349pfi.107.2023.07.19.02.04.04; Wed, 19 Jul 2023 02:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbjGSIo0 (ORCPT + 99 others); Wed, 19 Jul 2023 04:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjGSIoY (ORCPT ); Wed, 19 Jul 2023 04:44:24 -0400 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F3D0FC; Wed, 19 Jul 2023 01:44:23 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3128fcd58f3so6835379f8f.1; Wed, 19 Jul 2023 01:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689756261; x=1692348261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RT28KMZUfUxLqE36E2WVSHWEOsxWuK8+5KaakQzM+v8=; b=YavyBslqvgKfg5jrXB9gxeGsyVgB0y+5VsNNTX6tuEtyQjcs65B8nSLzVMEcagYrGa qWl2HN7tsYelNJvf11eBF5ZFv/a6K2Oe343QEZLK9e27sISimxKq/FAL9ZljQiNn3GJh b6N9+moZWqXRQcahaNbCO2eby3Jc4yoE/qX+9dVedoqiOU8iD/nHsnu6f8CWVp4F5zp2 NxPY8nDKVuwVZiVcFUW4lHvi5LvRZaTcGs0SmoWkI4X0ACH5CJXi+R1Dpyhmrcj++hiP mW8HN4Gj0LkPngQQMdCucaAMRXZLuCfkuk35mtio7lM1sR0Hs2HVFmXKHXz4g/Ogh5uJ PZcQ== X-Gm-Message-State: ABy/qLaq9cRLwxMkJvIX6RZdK7VRDSDVRV7MC4aGs8d12CaZp237+JHW LdSh6arwDGkAyfyTKMW2N8o= X-Received: by 2002:adf:ee43:0:b0:314:39d0:26f6 with SMTP id w3-20020adfee43000000b0031439d026f6mr14656317wro.18.1689756261248; Wed, 19 Jul 2023 01:44:21 -0700 (PDT) Received: from localhost (fwdproxy-cln-005.fbsv.net. [2a03:2880:31ff:5::face:b00c]) by smtp.gmail.com with ESMTPSA id k28-20020a5d525c000000b0030ada01ca78sm4688105wrc.10.2023.07.19.01.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 01:44:20 -0700 (PDT) From: Breno Leitao To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: leit@meta.com, Kuniyuki Iwashima , Alexei Starovoitov , Martin KaFai Lau , Alexander Mikhalitsyn , David Howells , Jason Xing , Xin Long , netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next] net: Use _K_SS_MAXSIZE instead of absolute value Date: Wed, 19 Jul 2023 01:44:12 -0700 Message-Id: <20230719084415.1378696-1-leitao@debian.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org Looking at sk_getsockopt function, it is unclear why 128 is a magical number. Use the proper macro, so it becomes clear to understand what the value mean, and get a reference where it is coming from (user-exported API). Signed-off-by: Breno Leitao --- net/core/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/sock.c index 9370fd50aa2c..58b6f00197d6 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1815,7 +1815,7 @@ int sk_getsockopt(struct sock *sk, int level, int optname, case SO_PEERNAME: { - char address[128]; + char address[_K_SS_MAXSIZE]; lv = sock->ops->getname(sock, (struct sockaddr *)address, 2); if (lv < 0) -- 2.34.1