summaryrefslogtreecommitdiffhomepage
path: root/src/selftest/ratelimiter.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-04 10:44:42 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-04 11:08:29 -0600
commit4ed60c09ee40f22f99afd59f3ff94866b7aa0cc4 (patch)
treedf5d7df445df552374ea62771c9ec2e3c6c511aa /src/selftest/ratelimiter.h
parent93b6e83e4faa8de6247e0e46d5060ec543befef8 (diff)
global: prefer sizeof(*pointer) when possible
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/selftest/ratelimiter.h')
-rw-r--r--src/selftest/ratelimiter.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selftest/ratelimiter.h b/src/selftest/ratelimiter.h
index a71ddb1..1f2b697 100644
--- a/src/selftest/ratelimiter.h
+++ b/src/selftest/ratelimiter.h
@@ -62,7 +62,7 @@ bool __init ratelimiter_selftest(void)
if (!skb4)
goto err_nofree;
skb4->protocol = htons(ETH_P_IP);
- hdr4 = (struct iphdr *)skb_put(skb4, sizeof(struct iphdr));
+ hdr4 = (struct iphdr *)skb_put(skb4, sizeof(*hdr4));
hdr4->saddr = htonl(8182);
skb_reset_network_header(skb4);
++test;
@@ -74,7 +74,7 @@ bool __init ratelimiter_selftest(void)
goto err_nofree;
}
skb6->protocol = htons(ETH_P_IPV6);
- hdr6 = (struct ipv6hdr *)skb_put(skb6, sizeof(struct ipv6hdr));
+ hdr6 = (struct ipv6hdr *)skb_put(skb6, sizeof(*hdr6));
hdr6->saddr.in6_u.u6_addr32[0] = htonl(1212);
hdr6->saddr.in6_u.u6_addr32[1] = htonl(289188);
skb_reset_network_header(skb6);