From 7f4cdc65a390c5bacab00cc38100d66637394476 Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Thu, 23 Feb 2023 18:36:11 +0100
Subject: fix: misc warnings

---
 src/user/app/netstack/tcp.c      | 4 ++--
 src/user/app/tests/kernel/misc.c | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/user/app')

diff --git a/src/user/app/netstack/tcp.c b/src/user/app/netstack/tcp.c
index daa728f..490ad5b 100644
--- a/src/user/app/netstack/tcp.c
+++ b/src/user/app/netstack/tcp.c
@@ -175,8 +175,8 @@ void tcp_parse(const uint8_t *buf, size_t len, struct ipv4 ip) {
 	uint32_t seq     = nget32(buf + Seq);
 	uint32_t acknum  = nget32(buf + AckNum);
 	uint16_t flags   = nget16(buf + Flags);
-	uint16_t winsize = nget16(buf + WinSize);
-	uint16_t chksum  = nget16(buf + Checksum);
+	// uint16_t winsize = nget16(buf + WinSize);
+	// uint16_t chksum  = nget16(buf + Checksum);
 	uint16_t hdrlen = ((flags & FlagSize) >> 12) * 4;
 	if (hdrlen > len) return;
 	uint16_t payloadlen = len - hdrlen;
diff --git a/src/user/app/tests/kernel/misc.c b/src/user/app/tests/kernel/misc.c
index b60ebc0..5d6b531 100644
--- a/src/user/app/tests/kernel/misc.c
+++ b/src/user/app/tests/kernel/misc.c
@@ -21,6 +21,7 @@ static void test_fault_kill(void) {
 }
 
 static void test_efault(void) {
+#if 0
 	const char *str = "o, 16 characters";
 	char str2[16];
 	char *invalid = (void*)0x1000;
@@ -51,6 +52,7 @@ static void test_efault(void) {
 
 	test(_sys_write(h, str, 16, 0, 0) == 16);
 	close(h);
+#endif
 }
 
 static void test_invalid_syscall(void) {
@@ -59,6 +61,6 @@ static void test_invalid_syscall(void) {
 
 void r_k_misc(void) {
 	run_test(test_fault_kill);
-	// run_test(test_efault);
+	run_test(test_efault);
 	run_test(test_invalid_syscall);
 }
-- 
cgit v1.2.3