diff netio.c @ 1563:1cbb7b3d6703

Merge fuzzing branch
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Feb 2018 22:12:05 +0800
parents 2f64cb3d3007
children 399d8eb961b5
line wrap: on
line diff
--- a/netio.c	Wed Feb 28 15:10:14 2018 +0100
+++ b/netio.c	Wed Feb 28 22:12:05 2018 +0800
@@ -245,6 +245,7 @@
 		}
 		iter = next_iter;
 	}
+	TRACE(("leave set_connect_fds"))
 }
 
 void handle_connect_fds(const fd_set *writefd) {
@@ -360,6 +361,12 @@
 	int so_prio_val = 0;
 #endif
 
+#if DROPBEAR_FUZZ
+	if (fuzz.fuzzing) {
+		TRACE(("fuzzing skips set_sock_prio"))
+		return;
+	}
+#endif
 
 	/* Don't log ENOTSOCK errors so that this can harmlessly be called
 	 * on a client '-J' proxy pipe */
@@ -584,6 +591,13 @@
 {
 	struct sockaddr_storage addr;
 	socklen_t addrlen;
+
+#if DROPBEAR_FUZZ
+	if (fuzz.fuzzing) {
+		fuzz_get_socket_address(fd, local_host, local_port, remote_host, remote_port, host_lookup);
+		return;
+	}
+#endif
 	
 	if (local_host || local_port) {
 		addrlen = sizeof(addr);