Skip to contentSkip to conversation

socket: pass correct size in net_socket_send()

PATCH Applied Jason Wang 3 participants 3 messages Jul 7, 2015 – Jul 9, 2015

Subsystems (2)
lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH 1/1 socket: pass correct size in net_socket_send()

We should pass the size of packet instead of the remaining to qemu_send_packet_async().

Fixes 6e99c631f116221d169ea53953d91b8aa74d297a

("net/socket: Drop net_socket_can_send")

---
 net/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/socket.c +1 -1
index c752696..b1e3b1c 100644
@@ -213,7 +213,7 @@ static void net_socket_send(void *opaque)
             if (s->index >= s->packet_len) {
                 s->index = 0;
                 s->state = 0;
-                if (qemu_send_packet_async(&s->nc, s->buf, size,
+                if (qemu_send_packet_async(&s->nc, s->buf, s->packet_len,
                                            net_socket_send_completed) == 0) {
                     net_socket_read_poll(s, false);
                     break;
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jason Wang

We should pass the size of packet instead of the remaining to qemu_send_packet_async().

Fixes 6e99c631f116221d169ea53953d91b8aa74d297a

("net/socket: Drop net_socket_can_send")

Thanks!

Quoted 20 lines
---
 net/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/socket.c +1 -1
index c752696..b1e3b1c 100644
@@ -213,7 +213,7 @@ static void net_socket_send(void *opaque)
             if (s->index >= s->packet_len) {
                 s->index = 0;
                 s->state = 0;
-                if (qemu_send_packet_async(&s->nc, s->buf, size,
+                if (qemu_send_packet_async(&s->nc, s->buf, s->packet_len,
                                            net_socket_send_completed) == 0) {
                     net_socket_read_poll(s, false);
                     break;
Signature · 1 line
2.1.4