networking: Fixes and updates
authorAlan Cox <alan@linux.intel.com>
Tue, 14 Nov 2017 00:43:30 +0000 (00:43 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 14 Nov 2017 00:43:30 +0000 (00:43 +0000)
Provide a 'connection has been reset rudely' callback
Fix the confusion between sd.err and s->s_error
Hopefully get the error handling on read/write correct now

At this point it seems to be behaving sanely.

Kernel/include/net_native.h
Kernel/include/netdev.h
Kernel/syscall_net.c

index a519aea..a0f00b6 100644 (file)
@@ -21,7 +21,6 @@
 
 struct sockdata {
        void *socket;
-       uint8_t err;
        uint8_t ret;
        uint8_t event;          /* Waiting events to go to user space */
 #define NEV_STATE      1
@@ -51,6 +50,7 @@ struct sockmsg {
 #define NE_ROOM                5
 #define NE_DATA                6
 #define NE_SHUTR        7
+#define NE_RESET        8
 
 struct netevent {
        uint8_t socket;
index eb05d4a..77b590a 100644 (file)
@@ -125,5 +125,5 @@ extern arg_t net_shutdown(struct socket *s, uint8_t how); /* bit 0 rd, bit 1 wr
 extern void netdev_init(void);
 extern struct socket *sock_find(uint8_t type, uint8_t sv, struct sockaddrs *sa);
 extern void sock_init(void);
-
+extern int sock_error(struct socket *s);
 extern struct netdevice net_dev;
index bf05b80..d40c5b6 100644 (file)
@@ -470,7 +470,7 @@ arg_t _connect(void)
                if (net_connect(s))
                        return -1;
                if (sock_wait_leave(s, 0, SS_CONNECTING)) {
-                       /* API oddity, thanks Berkley */
+                       /* API oddity, thanks Berkeley */
                        if (udata.u_error == EAGAIN)
                                udata.u_error = EINPROGRESS;
                        return -1;