diff options
author | David 'Digit' Turner <digit@android.com> | 2010-05-25 17:28:38 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-05-25 17:28:38 -0700 |
commit | 3bca7734dc4b3a9e1e24964183d9765780dee4ea (patch) | |
tree | 0ac454492c93edeca6ab12b5df7df361a8d41373 | |
parent | b74c48f113b1ebbe0f0e713502d653adaad7993f (diff) | |
download | external_qemu-3bca7734dc4b3a9e1e24964183d9765780dee4ea.zip external_qemu-3bca7734dc4b3a9e1e24964183d9765780dee4ea.tar.gz external_qemu-3bca7734dc4b3a9e1e24964183d9765780dee4ea.tar.bz2 |
Fix regression: -netspeed <speed> and -netdelay <latency> didn't work.
The bug was introduced in a past integration patch that moved code from vl.c
to net-android.c
Change-Id: I5415c27959da396975b51bcf047399a9781ccd8a
-rw-r--r-- | CHANGES.TXT | 2 | ||||
-rw-r--r-- | net-android.c | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/CHANGES.TXT b/CHANGES.TXT index 8338250..bbf1de2 100644 --- a/CHANGES.TXT +++ b/CHANGES.TXT @@ -39,6 +39,8 @@ OTHER: This allows testing situations where emulators need to communicate directly with each other. See '-help-shared-net-id' for more details. +- Fix net shaping regression: -netspeed and -netdelay did not work anymore. + ============================================================================== Changes between 6.0 and 5.0 diff --git a/net-android.c b/net-android.c index d208cd6..8649b82 100644 --- a/net-android.c +++ b/net-android.c @@ -750,7 +750,13 @@ slirp_init_shapers( void ) int slirp_can_output(void) { +#ifdef CONFIG_SHAPER + return !slirp_vc || + ( netshaper_can_send(slirp_shaper_out) && + qemu_can_send_packet(slirp_vc) ); +#else return !slirp_vc || qemu_can_send_packet(slirp_vc); +#endif } void slirp_output(const uint8_t *pkt, int pkt_len) @@ -764,7 +770,12 @@ void slirp_output(const uint8_t *pkt, int pkt_len) if (!slirp_vc) return; + +#ifdef CONFIG_SHAPER + netshaper_send(slirp_shaper_out, (void*)pkt, pkt_len); +#else qemu_send_packet(slirp_vc, pkt, pkt_len); +#endif } int slirp_is_inited(void) @@ -781,7 +792,11 @@ static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t siz if (qemu_tcpdump_active) qemu_tcpdump_packet(buf, size); +#ifdef CONFIG_SHAPER + netshaper_send(slirp_shaper_in, (char*)buf, size); +#else slirp_input(buf, size); +#endif return size; } |