# HG changeset patch # User dietmar.hahn@xxxxxxxxxxxxxxxxxxx # Date 1169817843 -3600 # Node ID 6d4800573fd7d97c4b007d3dc9f89bf883605063 # Parent 82c306ad212e3714cf9292611a0ddb8de7a3b5dc Signed-off-by: Dietmar Hahn - Handle returned backend==NULL || mac==NULL, this leads sometimes to a crash. - Handle initializing of np->rx.req_prod_pvt to avoid a compiler warning when using -O?. diff -r 82c306ad212e -r 6d4800573fd7 extras/mini-os/netfront.c --- a/extras/mini-os/netfront.c Thu Jan 25 10:34:17 2007 +0000 +++ b/extras/mini-os/netfront.c Fri Jan 26 14:24:03 2007 +0100 @@ -324,6 +324,14 @@ done: msg = xenbus_read(XBT_NIL, "device/vif/0/backend", &backend); msg = xenbus_read(XBT_NIL, "device/vif/0/mac", &mac); + if((backend == NULL) || (mac == NULL)) { + struct evtchn_close op = { info->local_port }; + printk("%s: backend/mac failed\n", __func__); + unbind_evtchn(info->local_port); + HYPERVISOR_event_channel_op(EVTCHNOP_close, &op); + return; + } + printk("backend at %s\n",backend); printk("mac is %s\n",mac); @@ -383,8 +391,10 @@ void init_rx_buffers(void) netif_rx_request_t *req; int notify; - np->rx.req_prod_pvt = requeue_idx; - + /* Initializing with 0 to avoid a cc warning with -O?, but + * initializing mmust be! */ + //np->rx.req_prod_pvt = requeue_idx; + np->rx.req_prod_pvt = 0; /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++)