fix container_of() on ustream callbacks
authorFelix Fietkau <nbd@openwrt.org>
Sat, 19 Jan 2013 15:47:37 +0000 (16:47 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 19 Jan 2013 15:47:51 +0000 (16:47 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
client.c

index d1584f917625a5bcca6dbeb642cbe4dc45758f74..bcb6897fb0282a09f2d85f4e61d915c7831d26a9 100644 (file)
--- a/client.c
+++ b/client.c
@@ -486,14 +486,14 @@ void uh_client_notify_state(struct client *cl)
 
 static void client_ustream_read_cb(struct ustream *s, int bytes)
 {
-       struct client *cl = container_of(s, struct client, sfd);
+       struct client *cl = container_of(s, struct client, sfd.stream);
 
        uh_client_read_cb(cl);
 }
 
 static void client_ustream_write_cb(struct ustream *s, int bytes)
 {
-       struct client *cl = container_of(s, struct client, sfd);
+       struct client *cl = container_of(s, struct client, sfd.stream);
 
        if (cl->dispatch.write_cb)
                cl->dispatch.write_cb(cl);
@@ -501,7 +501,7 @@ static void client_ustream_write_cb(struct ustream *s, int bytes)
 
 static void client_notify_state(struct ustream *s)
 {
-       struct client *cl = container_of(s, struct client, sfd);
+       struct client *cl = container_of(s, struct client, sfd.stream);
 
        uh_client_notify_state(cl);
 }