net: fix more bugs
authorAlan Cox <alan@linux.intel.com>
Tue, 12 Jan 2016 23:38:12 +0000 (23:38 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 12 Jan 2016 23:38:12 +0000 (23:38 +0000)
close() now works
connect() correctly calls into the net implementation but net_at hangs

Kernel/dev/net/net_at.c
Kernel/syscall_net.c

index 51fe621..7c08629 100644 (file)
@@ -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)
index 4aac477..add09d9 100644 (file)
@@ -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++;