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]
Date:	Tue, 23 Apr 2013 08:22:07 -0400
From:	Willem de Bruijn <willemb@...gle.com>
To:	Daniel Borkmann <dborkman@...hat.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	Paul Chavent <Paul.Chavent@...ra.fr>,
	Richard Cochran <richardcochran@...il.com>
Subject: Re: [PATCH net-next 3/5] packet: minor: convert status bits into
 shifting format

On Tue, Apr 23, 2013 at 6:39 AM, Daniel Borkmann <dborkman@...hat.com> wrote:
> This makes it more readable and clearer what bits are still free to
> use. The compiler reduces this to a constant for us anyway.
>
> Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
Acked-by: Willem de Bruijn <willemb@...gle.com>
> ---
>  This is just to bring the status bits' format in line with the
>  next patch.

This change is not strictly necessary on its own, but it does make
it easier to verify the high bits used in the next patch.

>  include/uapi/linux/if_packet.h | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
> index 8136658..4dfc234 100644
> --- a/include/uapi/linux/if_packet.h
> +++ b/include/uapi/linux/if_packet.h
> @@ -86,19 +86,19 @@ struct tpacket_auxdata {
>  };
>
>  /* Rx ring - header status */
> -#define TP_STATUS_KERNEL       0x0
> -#define TP_STATUS_USER         0x1
> -#define TP_STATUS_COPY         0x2
> -#define TP_STATUS_LOSING       0x4
> -#define TP_STATUS_CSUMNOTREADY 0x8
> -#define TP_STATUS_VLAN_VALID   0x10 /* auxdata has valid tp_vlan_tci */
> -#define TP_STATUS_BLK_TMO      0x20
> +#define TP_STATUS_KERNEL             0
> +#define TP_STATUS_USER         (1 << 0)
> +#define TP_STATUS_COPY         (1 << 1)
> +#define TP_STATUS_LOSING       (1 << 2)
> +#define TP_STATUS_CSUMNOTREADY (1 << 3)
> +#define TP_STATUS_VLAN_VALID   (1 << 4) /* auxdata has valid tp_vlan_tci */
> +#define TP_STATUS_BLK_TMO      (1 << 5)
>
>  /* Tx ring - header status */
> -#define TP_STATUS_AVAILABLE    0x0
> -#define TP_STATUS_SEND_REQUEST 0x1
> -#define TP_STATUS_SENDING      0x2
> -#define TP_STATUS_WRONG_FORMAT 0x4
> +#define TP_STATUS_AVAILABLE          0
> +#define TP_STATUS_SEND_REQUEST (1 << 0)
> +#define TP_STATUS_SENDING      (1 << 1)
> +#define TP_STATUS_WRONG_FORMAT (1 << 2)
>
>  /* Rx ring - feature request bits */
>  #define TP_FT_REQ_FILL_RXHASH  0x1
> --
> 1.7.11.7
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ