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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 27 Mar 2019 00:20:12 +0530
From:   Hariprasad Kelam <hariprasad.kelam@...il.com>
To:     rostedt@...dmis.org, mingo@...hat.com, laoar.shao@...il.com,
        davem@...emloft.net, linux-kernel@...r.kernel.org
Subject: [PATCH] net: trace : fix  error directive in argument list

This patch fixes below spare errors.

Sparse error:
make C=2 CF=-D__CHECK_ENDIAN__ M=net/core

./include/trace/events/sock.h:177:1: error: directive in argument list
./include/trace/events/sock.h:184:1: error: directive in argument list
./include/trace/events/sock.h:177:1: error: directive in argument list
./include/trace/events/sock.h:184:1: error: directive in argument list

Changed below two lines to signle line to avoid sparse error
-#if IS_ENABLED(CONFIG_IPV6)
-		if (sk->sk_family == AF_INET6) {
    to
if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {

Moved address assigning of pin6  struct outside the loop.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@...il.com>
---
 include/trace/events/sock.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index a0c4b8a..22bee26 100644
--- a/include/trace/events/sock.h
+++ b/include/trace/events/sock.h
@@ -174,16 +174,14 @@ TRACE_EVENT(inet_sock_set_state,
		p32 = (__be32 *) __entry->daddr;
		*p32 =  inet->inet_daddr;

-#if IS_ENABLED(CONFIG_IPV6)
-		if (sk->sk_family == AF_INET6) {
-			pin6 = (struct in6_addr *)__entry->saddr_v6;
+		pin6 = (struct in6_addr *)__entry->saddr_v6;
+
+		if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {
			*pin6 = sk->sk_v6_rcv_saddr;
			pin6 = (struct in6_addr *)__entry->daddr_v6;
			*pin6 = sk->sk_v6_daddr;
		} else
-#endif
		{
-			pin6 = (struct in6_addr *)__entry->saddr_v6;
			ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
			pin6 = (struct in6_addr *)__entry->daddr_v6;
			ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
-- 
2.7.4

Powered by blists - more mailing lists