lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD004C7B8@AcuExch.aculab.com>
Date:   Mon, 7 Aug 2017 09:28:41 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Xin Long' <lucien.xin@...il.com>,
        network dev <netdev@...r.kernel.org>,
        "linux-sctp@...r.kernel.org" <linux-sctp@...r.kernel.org>
CC:     Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
        Neil Horman <nhorman@...driver.com>,
        "davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [PATCH net-next 03/14] sctp: remove the typedef
 sctp_scope_policy_t

From: Xin Long
> Sent: 05 August 2017 13:00
> This patch is to remove the typedef sctp_scope_policy_t and keep
> it's members as an anonymous enum.
> 
> It is also to define SCTP_SCOPE_POLICY_MAX to replace the num 3
> in sysctl.c to make codes clear.
> 
> Signed-off-by: Xin Long <lucien.xin@...il.com>
> ---
>  include/net/sctp/constants.h | 6 ++++--
>  net/sctp/sysctl.c            | 2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
> index 922fba5..acb03eb 100644
> --- a/include/net/sctp/constants.h
> +++ b/include/net/sctp/constants.h
> @@ -341,12 +341,14 @@ typedef enum {
>  	SCTP_SCOPE_UNUSABLE,		/* IPv4 unusable addresses */
>  } sctp_scope_t;
> 
> -typedef enum {
> +enum {
>  	SCTP_SCOPE_POLICY_DISABLE,	/* Disable IPv4 address scoping */
>  	SCTP_SCOPE_POLICY_ENABLE,	/* Enable IPv4 address scoping */
>  	SCTP_SCOPE_POLICY_PRIVATE,	/* Follow draft but allow IPv4 private addresses */
>  	SCTP_SCOPE_POLICY_LINK,		/* Follow draft but allow IPv4 link local addresses */
> -} sctp_scope_policy_t;
> +};
> +
> +#define SCTP_SCOPE_POLICY_MAX	SCTP_SCOPE_POLICY_LINK

Perhaps slightly better to end the enum with:
	SCTP_SCOPE_POLICY_COUNT,	/* Number of policies */
	SCTP_SCOPE_POLICY_MAX = SCTP_SCOPE_POLICY_COUNT - 1	/* Last policy */
};

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ