Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109437403
D31941.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
575 B
Referenced Files
None
Subscribers
None
D31941.diff
View Options
diff --git a/tests/sys/netinet/libalias/util.c b/tests/sys/netinet/libalias/util.c
--- a/tests/sys/netinet/libalias/util.c
+++ b/tests/sys/netinet/libalias/util.c
@@ -109,9 +109,9 @@
struct udphdr *
set_udp(struct ip *p, u_short sport, u_short dport) {
- uint32_t *up = (void *)p;
- struct udphdr *u = (void *)&(up[p->ip_hl]);
- int payload = ntohs(p->ip_len) - 4*p->ip_hl;
+ int hlen = p->ip_hl << 2;
+ struct udphdr *u = (struct udphdr *)((uintptr_t)p + hlen);
+ int payload = ntohs(p->ip_len) - hlen;
REQUIRE(payload >= (int)sizeof(*u));
p->ip_p = IPPROTO_UDP;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 6, 1:33 AM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16484437
Default Alt Text
D31941.diff (575 B)
Attached To
Mode
D31941: Cast pointer to uintptr_t to avoid alignment warnings.
Attached
Detach File
Event Timeline
Log In to Comment