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: <ZCrMFtTxZSjqjdTZ@kernel.org>
Date:   Mon, 3 Apr 2023 14:52:38 +0200
From:   Simon Horman <horms@...nel.org>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>, Felix Fietkau <nbd@....name>,
        John Crispin <john@...ozen.org>,
        Sean Wang <sean.wang@...iatek.com>,
        Mark Lee <Mark-MC.Lee@...iatek.com>,
        Lorenzo Bianconi <lorenzo@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] net: ethernet: mtk_eth_soc: use be32 type to store be32
 values

On Sat, Apr 01, 2023 at 05:55:35PM +0200, Andrew Lunn wrote:
> On Sat, Apr 01, 2023 at 08:43:44AM +0200, Simon Horman wrote:
> > Perhaps there is a nicer way to handle this but the code
> > calls for converting an array of host byte order 32bit values
> > to big endian 32bit values: an ipv6 address to be pretty printed.
> 
> Hi Simon
> 
> Maybe make a generic helper? I could be used in other places, e.g:
> 
> https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c#L6773

Hi Andrew,

do you mean something like this?

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 7332296eca44..cff6c1177502 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -935,6 +935,11 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow,
 	flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
 }
 
+static inline void ipv6_addr_cpu_to_be32(__be32 *dst, const u32 *src)
+{
+	cpu_to_be32_array(dst, src, 4);
+}
+
 #if IS_ENABLED(CONFIG_IPV6)
 
 static inline bool ipv6_can_nonlocal_bind(struct net *net,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ