From 06beffa4f8f350aad6f6167abb7bebeecd0166ff Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Mon, 22 Aug 2022 15:00:49 +0200
Subject: user/netstack: fix some meaningless type warnings

---
 src/user/app/netstack/arp.c   | 2 +-
 src/user/app/netstack/ether.c | 4 ++--
 src/user/app/netstack/udp.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/user')

diff --git a/src/user/app/netstack/arp.c b/src/user/app/netstack/arp.c
index cfb1e04..9eab8e3 100644
--- a/src/user/app/netstack/arp.c
+++ b/src/user/app/netstack/arp.c
@@ -31,7 +31,7 @@ void arp_parse(const uint8_t *buf, size_t len) {
 		uint32_t daddr = nget32(buf + DstIP);
 		if (daddr == state.ip) {
 			uint8_t *pkt = ether_start(30, (struct ethernet){
-				.dst = buf + SrcMAC,
+				.dst = (void*)(buf + SrcMAC),
 				.type = ET_ARP,
 			});
 			nput16(pkt + HdrType, 1);
diff --git a/src/user/app/netstack/ether.c b/src/user/app/netstack/ether.c
index 5893632..20d16ab 100644
--- a/src/user/app/netstack/ether.c
+++ b/src/user/app/netstack/ether.c
@@ -12,8 +12,8 @@ struct ethq *ether_queue;
 
 void ether_parse(const uint8_t *buf, size_t len) {
 	struct ethernet ether = (struct ethernet){
-		.src = buf + SrcMAC,
-		.dst = buf + DstMAC,
+		.src = (void*)(buf + SrcMAC),
+		.dst = (void*)(buf + DstMAC),
 		.type = nget16(buf + EtherType),
 	};
 
diff --git a/src/user/app/netstack/udp.c b/src/user/app/netstack/udp.c
index 8129a48..d53137d 100644
--- a/src/user/app/netstack/udp.c
+++ b/src/user/app/netstack/udp.c
@@ -54,7 +54,7 @@ void udpc_send(struct udp_conn *c, const void *buf, size_t len) {
 		.proto = 0x11,
 		.src = c->lip,
 		.dst = c->rip,
-		.e.dst = c->rmac,
+		.e.dst = &c->rmac,
 	});
 	free(pkt);
 }
-- 
cgit v1.2.3