mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Thu 18 Aug 2016 06:36:16 BST # gpg: using RSA key 0xEF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: net/net: properly handle multiple packets in net_fill_rstate() net: vmxnet: use g_new for pkt initialisation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+2
-3
@@ -65,10 +65,9 @@ void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev,
|
||||
|
||||
p->pci_dev = pci_dev;
|
||||
|
||||
p->vec = g_malloc((sizeof *p->vec) *
|
||||
(max_frags + NET_TX_PKT_PL_START_FRAG));
|
||||
p->vec = g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG);
|
||||
|
||||
p->raw = g_malloc((sizeof *p->raw) * max_frags);
|
||||
p->raw = g_new(struct iovec, max_frags);
|
||||
|
||||
p->max_payload_frags = max_frags;
|
||||
p->max_raw_frags = max_frags;
|
||||
|
||||
@@ -1602,9 +1602,8 @@ void net_socket_rs_init(SocketReadState *rs,
|
||||
|
||||
/*
|
||||
* Returns
|
||||
* 0: SocketReadState is not ready
|
||||
* 1: SocketReadState is ready
|
||||
* otherwise error occurs
|
||||
* 0: success
|
||||
* -1: error occurs
|
||||
*/
|
||||
int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
{
|
||||
@@ -1652,10 +1651,11 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
if (rs->finalize) {
|
||||
rs->finalize(rs);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(size == 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user