]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: introduce and use typedef in6_addr_t
authorAlan Maguire <alan.maguire@oracle.com>
Mon, 23 Jan 2017 15:18:31 +0000 (15:18 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 15 Feb 2017 16:12:05 +0000 (16:12 +0000)
This is for consistency with the similar typedef in_addr_t: we have
to use the typedef in at least one place in the module so that the
compiler incorporates it into the DWARF and it ends up in the CTF
section.  (Both the DTrace ip translators and, likely, the users
would expect that if one typedef exists, the other one does too.)

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
Orabug: 25557554

dtrace/dtrace_dif.c
dtrace/include/dtrace/provider_defines.h

index 9f830e15a06a725e77339579aaa7d17e5db7d19e..c6c297dfbf7f4ded21203ffc6d43f98cea81bf0a 100644 (file)
@@ -3688,7 +3688,7 @@ next:
                        ASSERT(end + 1 >= base);
 #ifdef CONFIG_IPV6
                } else if (af == AF_INET6) {
-                       struct in6_addr ip6;
+                       in6_addr_t      ip6;
                        int             firstzero, tryzero, numzero, v6end;
                        uint16_t        val;
                        const char      digits[] = "0123456789abcdef";
@@ -3707,7 +3707,7 @@ next:
                         */
                        dtrace_bcopy(
                            (void *)(uintptr_t)tupregs[argi].dttk_value,
-                           (void *)(uintptr_t)&ip6, sizeof(struct in6_addr));
+                           (void *)(uintptr_t)&ip6, sizeof(in6_addr_t));
 
                        /*
                         * Check an IPv6 string will fit in scratch.
@@ -3729,7 +3729,7 @@ next:
                        firstzero = -1;
                        tryzero = -1;
                        numzero = 1;
-                       for (i = 0; i < sizeof(struct in6_addr); i++) {
+                       for (i = 0; i < sizeof(in6_addr_t); i++) {
                                if (ip6.s6_addr[i] == 0 &&
                                    tryzero == -1 && i % 2 == 0) {
                                        tryzero = i;
@@ -3738,7 +3738,7 @@ next:
 
                                if (tryzero != -1 &&
                                    (ip6.s6_addr[i] != 0 ||
-                                   i == sizeof(struct in6_addr) - 1)) {
+                                   i == sizeof(in6_addr_t) - 1)) {
 
                                        if (i - tryzero <= numzero) {
                                                tryzero = -1;
@@ -3750,19 +3750,19 @@ next:
                                        tryzero = -1;
 
                                        if (ip6.s6_addr[i] == 0 &&
-                                           i == sizeof(struct in6_addr) - 1)
+                                           i == sizeof(in6_addr_t) - 1)
                                                numzero += 2;
                                }
                        }
-                       ASSERT(firstzero + numzero <= sizeof(struct in6_addr));
+                       ASSERT(firstzero + numzero <= sizeof(in6_addr_t));
 
                        /*
                         * Check for an IPv4 embedded address.
                         */
-                       v6end = sizeof(struct in6_addr) - 2;
-                       if (ipv6_addr_type(&ip6) |
+                       v6end = sizeof(in6_addr_t) - 2;
+                       if (ipv6_addr_type(&ip6) &
                            (IPV6_ADDR_COMPATv4 | IPV6_ADDR_MAPPED)) {
-                               for (i = sizeof(struct in6_addr) - 1;
+                               for (i = sizeof(in6_addr_t) - 1;
                                    i >= DTRACE_V4MAPPED_OFFSET; i--) {
                                        ASSERT(end >= base);
 
index 676a98726d83e835960c59c218fdd27cc3cd2ac1..a21b05930a7d144681b771779543b34a8f9be623 100644 (file)
 
 #include <linux/dtrace/universal.h>
 #include <linux/cred.h>
+#include <linux/in6.h>
 
 typedef uintptr_t              dtrace_provider_id_t;
 typedef uintptr_t              dtrace_meta_provider_id_t;
 typedef struct cred    cred_t;
 typedef __be32         ipaddr_t;
+typedef struct in6_addr        in6_addr_t;
 
 struct dtrace_pops;
 struct dtrace_helper_probedesc;