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] [day] [month] [year] [list]
Message-ID: <20200118071013.GL2131@nanopsycho>
Date:   Sat, 18 Jan 2020 08:10:13 +0100
From:   Jiri Pirko <jiri@...nulli.us>
To:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [RFC net-next PATCH] ipv6: New define for reoccurring code

Fri, Jan 17, 2020 at 10:56:42PM CET, jeffrey.t.kirsher@...el.com wrote:
>Through out the kernel, sizeof() is used to determine the size of the IPv6
>address structure, so create a define for the commonly used code.
>
>s/sizeof(struct in6_addr)/ipv6_addr_size/g
>
>This is just a portion of the instances in the kernel and before cleaning
>up all the occurrences, wanted to make sure that this was a desired change
>or if this obfuscates the code.
>
>Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
>---
> include/uapi/linux/in6.h                       |  1 +
> net/core/filter.c                              |  2 +-
> net/core/pktgen.c                              |  2 +-
> net/ipv6/addrconf.c                            | 14 +++++++-------
> net/ipv6/addrlabel.c                           |  2 +-
> net/ipv6/exthdrs.c                             |  4 ++--
> net/ipv6/fib6_rules.c                          |  6 +++---
> net/ipv6/ila/ila_lwt.c                         |  2 +-
> net/ipv6/ip6_gre.c                             | 18 +++++++++---------
> net/ipv6/ip6_output.c                          |  2 +-
> net/ipv6/ip6_tunnel.c                          | 14 +++++++-------
> net/ipv6/ip6_vti.c                             | 14 +++++++-------
> net/ipv6/ip6mr.c                               | 10 +++++-----
> net/ipv6/ipcomp6.c                             |  4 ++--
> net/ipv6/ndisc.c                               |  4 ++--
> net/ipv6/netfilter/ip6t_rpfilter.c             |  2 +-
> net/ipv6/netfilter/ip6t_srh.c                  |  4 ++--
> net/ipv6/netfilter/nft_dup_ipv6.c              |  2 +-
> net/ipv6/seg6.c                                |  4 ++--
> net/ipv6/seg6_iptunnel.c                       |  4 ++--
> net/ipv6/seg6_local.c                          | 12 ++++++------
> net/ipv6/sit.c                                 |  4 ++--
> net/openvswitch/conntrack.c                    |  4 ++--
> net/openvswitch/flow_netlink.c                 |  4 ++--
> net/sched/cls_flower.c                         | 16 ++++++++--------
> net/socket.c                                   |  2 +-
> security/selinux/netnode.c                     |  2 +-
> tools/lib/traceevent/event-parse.c             |  2 +-
> tools/testing/selftests/bpf/test_sock_addr.c   |  2 +-
> .../networking/timestamping/txtimestamp.c      |  2 +-
> 30 files changed, 83 insertions(+), 82 deletions(-)
>
>diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
>index 9f2273a08356..24547a51e715 100644
>--- a/include/uapi/linux/in6.h
>+++ b/include/uapi/linux/in6.h
>@@ -44,6 +44,7 @@ struct in6_addr {
> #define s6_addr32		in6_u.u6_addr32
> #endif
> };
>+#define ipv6_addr_size		sizeof(struct in6_addr)

Shouldn't it be rather "in6_addr_size" to be aligned with the struct
name? Also, as it is a define shouldn't it be rather "IN6_ADDR_SIZE"?

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ