Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2819205rwi; Fri, 28 Oct 2022 11:38:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qIpKUNzZnC1wjeaTh/Pb/clM1iAuN5YjAFqiRQIl02P9ReLux/9ShkIpBlJfLBKnsqBhs X-Received: by 2002:a17:902:b788:b0:186:a810:4072 with SMTP id e8-20020a170902b78800b00186a8104072mr363656pls.86.1666982299354; Fri, 28 Oct 2022 11:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666982299; cv=none; d=google.com; s=arc-20160816; b=OVU5V/7E2wfP+ONcnmwTpA6fnsTI9IfzmhTb9Pahr1zwpPl8tfkaluuM+cWZwf77a6 5dbDrPqqHbGTqLq/AxmiRLg0VGxP4HcMMG7HF0Fk+LODHguppzmwoHZtvTsUIePX4Rxi 6L8nXlleSa4XGHyZPzHujFgYwpaCs+ifnxcIAFr02f8Ae/xyuL1m2c0xkz1LTgxIBgWm N0Tn79FClfXiiXFfQKenkuOcvs5m302hyDlM2+bMI8gVLhVtUmTKrndcLprmbOBKra/X g2olQMSOVdLKs/oyEKU8BapQK5RhGT4pguwGH4q4ODNcidLHF+Spdih3Z21chS5nlIL6 oUQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=DmkRUERi/djKN+dUf3WvsFjA+judctr5yaDrjNmVGio=; b=Z7um24BbVpmYzYrBmpAoN4F1Te+rExFhYCef+Db8Qrg7vix0VCgqJyzm5478irpyRz 1byOw6V0gp2NVRYbBOm28RZjk7cVmI8XEDG/d884AmM3qsK7G1Yt4kJM/BTwZb+s3qCH LQZVe0oOwlDx3hm7NGUOeHs9sxOtfq790OsJz62iOuZeCCDDKRY+NU3aIkeJpHRPaOT2 1CD8tUQV1VtTCptzMmFkXm3JY5tSM4nsGyPAMYvcE4wRqUMaV0ZbieS7zrnKaWg1EIpN 6PdQPVtqPTrsPWc4tQk39avvS1LmPlQVkm6CL5xPG7TFKawuGlm5rLtRxLiGzo6cx1AL 46iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jJFCoxM3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a656744000000b0046eecbac47esi6599205pgu.28.2022.10.28.11.38.07; Fri, 28 Oct 2022 11:38: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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jJFCoxM3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbiJ1RLu (ORCPT + 99 others); Fri, 28 Oct 2022 13:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbiJ1RL2 (ORCPT ); Fri, 28 Oct 2022 13:11:28 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0334AB2F; Fri, 28 Oct 2022 10:09:29 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id y14so14402936ejd.9; Fri, 28 Oct 2022 10:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DmkRUERi/djKN+dUf3WvsFjA+judctr5yaDrjNmVGio=; b=jJFCoxM3RAvvEja4GZB2/BapzDQxhh3QnIzT/wXZpRjFyOTy+utBzX7fiOvmhwnV0C 8x3jVKGfbLsn0UCb8mKpMjvBG2lqI2pTUqS1C365iL1qxpO9VY2Sm9w/bJL4jUYRmSiU 0xqnARPXB0H9WNJinmuzp2q3wwGLwSUFxDd4Yv+8Bm+kVvdwyMw84lHsUC0KEKgpzTDg 8hQUvAoEg82WjgVq1lI0NjjhLSxzyP+f3qvxAtK/68+pfF+eSiDBj3FQROHdEx8dSKHs 7pta2FzaYSzo6UBoub4U7+9ls96o3mQYwGD4Ck2bvXiJKtycWpN0I6Au8SpCtt/HVf2S 4mjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DmkRUERi/djKN+dUf3WvsFjA+judctr5yaDrjNmVGio=; b=MfUyUZEbdIv+JWEJ/sNh9go6FvbQM4rHmlHhM4UNo5t3eb0JRr+UgdKl2bLt4KOUN+ VDWN+PhOQidviM7+OBIbEa6BtNY8jRZq4MecU16wgEEOChmyajoNmPd0Y/x44fMd0Fdm ikOKoUy7baL2pJGvJ1+8jwTU9cgJaAq0N96s3Ke5zgCjtdWkLautRnm7S6vvs6g42JSA OMuPeWVlu5pIf3LtbgYDiT7jark9mhXoMN1pqrYCmGYxENxJMa9UVgpShr0inDUXE+uJ QrYngGTEU+OfMbYRKIJWzoS3wyNorsNOrNaFbrfEs7VWHc9Sebr5OVJvehs8/BauQZ5g bwSA== X-Gm-Message-State: ACrzQf1dx0kc13ivXDb9l+nh3hf2HFznHYjqKD1T9h0TQI3KvKfmcG0Z 0qv/EgepkbxQW3jI2mVCbzYi7ePqOGWQYsuXdbU= X-Received: by 2002:a17:906:99c5:b0:73d:70c5:1a4f with SMTP id s5-20020a17090699c500b0073d70c51a4fmr327011ejn.302.1666976968337; Fri, 28 Oct 2022 10:09:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrii Nakryiko Date: Fri, 28 Oct 2022 10:09:16 -0700 Message-ID: Subject: Re: [PATCH] samples/bpf: Fix sockex3: missing BPF prog type To: Rong Tao Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net, haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org, linux-kernel@vger.kernel.org, martin.lau@linux.dev, rongtao@cestc.cn, sdf@google.com, song@kernel.org, yhs@fb.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Thu, Oct 27, 2022 at 6:01 PM Rong Tao wrote: > > Thanks for your reply, actually, i tried another method, which can solved > this error, recognize "socket/xxx" as "socket". However, it maybe influence > other BPF prog or not? What do you think the following patch? Don't fix libbpf, it's not broken. Fix the sample. > > --- a/tools/lib/bpf/libbpf.c > +++ b/tools/lib/bpf/libbpf.c > @@ -8659,7 +8659,7 @@ static bool sec_def_matches(const struct bpf_sec_def *sec_def, const char *sec_n > return false; > } > > - return strcmp(sec_name, sec_def->sec) == 0; > + return strncmp(sec_name, sec_def->sec, len) == 0; > }