Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115976456
D31941.id95729.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
594 B
Referenced Files
None
Subscribers
None
D31941.id95729.diff
View Options
Index: tests/sys/netinet/libalias/util.c
===================================================================
--- tests/sys/netinet/libalias/util.c
+++ 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 *)((caddr_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
Fri, May 2, 3:05 AM (1 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17896923
Default Alt Text
D31941.id95729.diff (594 B)
Attached To
Mode
D31941: Cast pointer to uintptr_t to avoid alignment warnings.
Attached
Detach File
Event Timeline
Log In to Comment