From 4cad42892df821f22ea37fc5bb571bab3828becb Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 12 Jan 2016 23:38:12 +0000 Subject: [PATCH] net: fix more bugs close() now works connect() correctly calls into the net implementation but net_at hangs --- Kernel/dev/net/net_at.c | 2 +- Kernel/syscall_net.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/dev/net/net_at.c b/Kernel/dev/net/net_at.c index 51fe6218..7c086290 100644 --- a/Kernel/dev/net/net_at.c +++ b/Kernel/dev/net/net_at.c @@ -137,7 +137,7 @@ void net_close(struct socket *s) netat_do_hangup(); /* Either +++ ATH with spacing, or carrier drop */ at_state = 0; } - s->s_state = SS_UNUSED; + s->s_state = SS_CLOSED; } arg_t net_read(struct socket *s, uint8_t flag) diff --git a/Kernel/syscall_net.c b/Kernel/syscall_net.c index 4aac477f..add09d9a 100644 --- a/Kernel/syscall_net.c +++ b/Kernel/syscall_net.c @@ -312,7 +312,7 @@ arg_t _socket(void) /* Find the socket */ while (s && s < socktypes + NSOCKTYPE) { if (s->af == afv && s->type == typev) { - if (s->pf == 0 || s->pf == pfv) + if (pfv == 0 || s->pf == 0 || s->pf == pfv) return make_socket(s, NULL); } s++; -- 2.34.1