From patchwork Thu May 21 23:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 225480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C9E1C433DF for ; Thu, 21 May 2020 23:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 657C320814 for ; Thu, 21 May 2020 23:39:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NEvN3AxR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729657AbgEUXjs (ORCPT ); Thu, 21 May 2020 19:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728706AbgEUXjr (ORCPT ); Thu, 21 May 2020 19:39:47 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98356C061A0E for ; Thu, 21 May 2020 16:39:47 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id 19so9680807qtp.8 for ; Thu, 21 May 2020 16:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=krsDlQ6qx5PkK3NDZqNCeEPpgBEpikLUWKTXMu7x+0w=; b=NEvN3AxRTyacDAi0XY+OKuE2ZwgZlqz/V9zcpNC9fdbxJLZnTymD5qnbQs3JaBI+oF zwNlyarncg7L/c24XzIIO/T6C+IgwxmZD3KI13piwohVSBmaRkjPw2zGpGmEn4ChWbk7 Oxj4nCBehGQkVgpe3VNKmhpPnolbcbtije0z7GJNh82MpbKlAzfHafgQm6kjlnSnC3GN UcbhA8NqhwgjMTJIAxqc/fI9oAeMd9wzn9NxTzmoCiV2ZawPbodibyDa7ThbjeRnA09I q4XM+fHB2hPk9G2X1IKhukv9URCk3Wn8lzHaXGB3KNfRHLLgsmf/wAbfUhooB3m3uPN1 zMyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=krsDlQ6qx5PkK3NDZqNCeEPpgBEpikLUWKTXMu7x+0w=; b=UwPk3TnbvS1BJUeZPFvHzJt0M3uZ3TBNRmVU/qyx/5KSypLLnC91YlXLB9iXnTiGN4 9NYiYvlPKivjfxAQj5KIOHro6ipBhW9/90GV9Z+gmgRm33r8cEELt+6pbwOlY6hPu8TC hbfjyKv4AWwbHRQRFNfsa1f/ua65MSY9geFhtWs+4LwXbIlrjtrqVtDkDEPvbz3Mw1t2 ny5dKUQIim+Ud/4ij74QZyv2amPqwrNJbxBOFeHf2KlSjZECv039+eB3yWnwCssmJFzK 4rPlOb2Ol4pVFoVpwHse5fXrWfiPjbLPDte7TSe51XEOZmWr14ZdE0YPFF12pULBAwHG Ypkg== X-Gm-Message-State: AOAM530fhtYCWuYhuxn7hD/3KX5b1kT2uLOrEAcPED4C7hrXywYbvFFn Izl6CL6+07dkmpFvD8RrVK/J4GxDny+yQQ== X-Google-Smtp-Source: ABdhPJwIC5kHKRmtwhJM3Y+XC4pu1Z4+Sgv9t9tj/elczDrYv3UHJkkt4GUC4Cthuc7fY+BsM1BrJIa8hgyzug== X-Received: by 2002:a0c:fde4:: with SMTP id m4mr1163673qvu.207.1590104386699; Thu, 21 May 2020 16:39:46 -0700 (PDT) Date: Fri, 22 May 2020 00:39:16 +0100 In-Reply-To: <20200521233937.175182-1-gprocida@google.com> Message-Id: <20200521233937.175182-2-gprocida@google.com> Mime-Version: 1.0 References: <20200521144100.128936-1-gprocida@google.com> <20200521233937.175182-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog Subject: [PATCH v2 01/22] net: l2tp: export debug flags to UAPI From: Giuliano Procida To: greg@kroah.com Cc: stable@vger.kernel.org, "=?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?=" , "David S . Miller" , Giuliano Procida Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Asbjørn Sloth Tønnesen commit 41c43fbee68f4f9a2a9675d83bca91c77862d7f0 upstream. Move the L2TP_MSG_* definitions to UAPI, as it is part of the netlink API. Signed-off-by: Asbjoern Sloth Toennesen Signed-off-by: David S. Miller Signed-off-by: Giuliano Procida --- include/uapi/linux/l2tp.h | 17 ++++++++++++++++- net/l2tp/l2tp_core.h | 10 ---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h index 4bd27d0270a2..bb2d62037037 100644 --- a/include/uapi/linux/l2tp.h +++ b/include/uapi/linux/l2tp.h @@ -108,7 +108,7 @@ enum { L2TP_ATTR_VLAN_ID, /* u16 */ L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */ L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */ - L2TP_ATTR_DEBUG, /* u32 */ + L2TP_ATTR_DEBUG, /* u32, enum l2tp_debug_flags */ L2TP_ATTR_RECV_SEQ, /* u8 */ L2TP_ATTR_SEND_SEQ, /* u8 */ L2TP_ATTR_LNS_MODE, /* u8 */ @@ -175,6 +175,21 @@ enum l2tp_seqmode { L2TP_SEQ_ALL = 2, }; +/** + * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions + * + * @L2TP_MSG_DEBUG: verbose debug (if compiled in) + * @L2TP_MSG_CONTROL: userspace - kernel interface + * @L2TP_MSG_SEQ: sequence numbers + * @L2TP_MSG_DATA: data packets + */ +enum l2tp_debug_flags { + L2TP_MSG_DEBUG = (1 << 0), + L2TP_MSG_CONTROL = (1 << 1), + L2TP_MSG_SEQ = (1 << 2), + L2TP_MSG_DATA = (1 << 3), +}; + /* * NETLINK_GENERIC related info */ diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 7c2037184b6c..092698a8f74b 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h @@ -23,16 +23,6 @@ #define L2TP_HASH_BITS_2 8 #define L2TP_HASH_SIZE_2 (1 << L2TP_HASH_BITS_2) -/* Debug message categories for the DEBUG socket option */ -enum { - L2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if - * compiled in) */ - L2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel - * interface */ - L2TP_MSG_SEQ = (1 << 2), /* sequence numbers */ - L2TP_MSG_DATA = (1 << 3), /* data packets */ -}; - struct sk_buff; struct l2tp_stats {