Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167599071
D51662.id159522.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
917 B
Referenced Files
None
Subscribers
None
D51662.id159522.diff
View Options
diff --git a/stand/libsa/ip.c b/stand/libsa/ip.c
--- a/stand/libsa/ip.c
+++ b/stand/libsa/ip.c
@@ -181,6 +181,7 @@
ssize_t n;
size_t hlen;
struct ether_header *eh;
+ void *buf;
struct ip *ip;
struct udphdr *uh;
uint16_t etype; /* host order */
@@ -195,7 +196,7 @@
ip = NULL;
ptr = NULL;
- n = readether(d, (void **)&ptr, (void **)&ip, tleft, &etype);
+ n = readether(d, (void **)&ptr, (void **)&buf, tleft, &etype);
if (n == -1 || n < sizeof(*ip) + sizeof(*uh)) {
free(ptr);
return (-1);
@@ -205,7 +206,7 @@
/* Need to respond to ARP requests. */
if (etype == ETHERTYPE_ARP) {
- struct arphdr *ah = (void *)ip;
+ struct arphdr *ah = buf;
if (ah->ar_op == htons(ARPOP_REQUEST)) {
/* Send ARP reply */
arp_reply(d, ah);
@@ -224,6 +225,7 @@
return (-1);
}
+ ip = buf;
/* Check ip header */
if (ip->ip_v != IPVERSION || /* half char */
ip->ip_p != proto) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 24, 12:33 AM (19 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37167743
Default Alt Text
D51662.id159522.diff (917 B)
Attached To
Mode
D51662: libsa: errors with pointer conversion
Attached
Detach File
Event Timeline
Log In to Comment