Revision 1eec614b net.c
b/net.c | ||
---|---|---|
333 | 333 |
{ |
334 | 334 |
VLANClientState *vc, **pvc; |
335 | 335 |
vc = qemu_mallocz(sizeof(VLANClientState)); |
336 |
if (!vc) |
|
337 |
return NULL; |
|
338 | 336 |
vc->model = strdup(model); |
339 | 337 |
if (name) |
340 | 338 |
vc->name = strdup(name); |
... | ... | |
728 | 726 |
TAPState *s; |
729 | 727 |
|
730 | 728 |
s = qemu_mallocz(sizeof(TAPState)); |
731 |
if (!s) |
|
732 |
return NULL; |
|
733 | 729 |
s->fd = fd; |
734 | 730 |
s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s); |
735 | 731 |
#ifdef HAVE_IOVEC |
... | ... | |
1049 | 1045 |
}; |
1050 | 1046 |
|
1051 | 1047 |
s = qemu_mallocz(sizeof(VDEState)); |
1052 |
if (!s) |
|
1053 |
return -1; |
|
1054 | 1048 |
s->vde = vde_open(init_sock, "QEMU", &args); |
1055 | 1049 |
if (!s->vde){ |
1056 | 1050 |
free(s); |
... | ... | |
1274 | 1268 |
} |
1275 | 1269 |
|
1276 | 1270 |
s = qemu_mallocz(sizeof(NetSocketState)); |
1277 |
if (!s) |
|
1278 |
return NULL; |
|
1279 | 1271 |
s->fd = fd; |
1280 | 1272 |
|
1281 | 1273 |
s->vc = qemu_new_vlan_client(vlan, model, name, net_socket_receive_dgram, NULL, s); |
... | ... | |
1304 | 1296 |
{ |
1305 | 1297 |
NetSocketState *s; |
1306 | 1298 |
s = qemu_mallocz(sizeof(NetSocketState)); |
1307 |
if (!s) |
|
1308 |
return NULL; |
|
1309 | 1299 |
s->fd = fd; |
1310 | 1300 |
s->vc = qemu_new_vlan_client(vlan, model, name, |
1311 | 1301 |
net_socket_receive, NULL, s); |
... | ... | |
1383 | 1373 |
return -1; |
1384 | 1374 |
|
1385 | 1375 |
s = qemu_mallocz(sizeof(NetSocketListenState)); |
1386 |
if (!s) |
|
1387 |
return -1; |
|
1388 | 1376 |
|
1389 | 1377 |
fd = socket(PF_INET, SOCK_STREAM, 0); |
1390 | 1378 |
if (fd < 0) { |
... | ... | |
1504 | 1492 |
return vlan; |
1505 | 1493 |
} |
1506 | 1494 |
vlan = qemu_mallocz(sizeof(VLANState)); |
1507 |
if (!vlan) |
|
1508 |
return NULL; |
|
1509 | 1495 |
vlan->id = id; |
1510 | 1496 |
vlan->next = NULL; |
1511 | 1497 |
pvlan = &first_vlan; |
Also available in: Unified diff