--- Gnu-Mach/xen/net.c 2020/09/02 04:45:34 1.1 +++ Gnu-Mach/xen/net.c 2020/09/02 04:52:15 1.1.1.3 @@ -119,10 +119,10 @@ static void enqueue_rx_buf(struct net_da } static int recompute_checksum(void *data, int len) { - unsigned16_t *header16 = data; - unsigned8_t *header8 = data; + uint16_t *header16 = data; + uint8_t *header8 = data; unsigned length, i; - unsigned32_t checksum = 0; + uint32_t checksum = 0; /* IPv4 header length */ length = (header8[0] & 0xf) * 4; @@ -145,8 +145,8 @@ static int recompute_checksum(void *data if (header8[9] == 6) { /* Need to fix TCP checksum as well */ - unsigned16_t *tcp_header16 = header16 + length/2; - unsigned8_t *tcp_header8 = header8 + length; + uint16_t *tcp_header16 = header16 + length/2; + uint8_t *tcp_header8 = header8 + length; unsigned tcp_length = ntohs(header16[1]) - length; /* Pseudo IP header */ @@ -166,7 +166,7 @@ static int recompute_checksum(void *data tcp_header16[8] = htons(~checksum); } else if (header8[9] == 17) { /* Drop any bogus checksum */ - unsigned16_t *udp_header16 = header16 + length/2; + uint16_t *udp_header16 = header16 + length/2; udp_header16[3] = 0; } @@ -395,7 +395,7 @@ void hyp_net_init(void) { /* Allocate an event channel and give it to backend. */ nd->evt = evt = hyp_event_channel_alloc(domid); - i = sprintf(port_name, "%lu", evt); + i = sprintf(port_name, "%u", evt); c = hyp_store_write(t, port_name, 5, VIF_PATH, "/", vifs[n], "/", "event-channel"); if (!c) panic("eth: couldn't store event channel for VIF %s (%s)", vifs[n], hyp_store_error); @@ -538,7 +538,7 @@ static io_return_t device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, dev_mode_t mode, char *name, device_t *devp /* out */) { - int i, n, err = 0; + int i, n; ipc_port_t port, notify; struct net_data *nd; @@ -568,8 +568,8 @@ device_open (ipc_port_t reply_port, mach port = ipc_port_alloc_kernel(); if (port == IP_NULL) { - err = KERN_RESOURCE_SHORTAGE; - goto out; + device_close (nd); + return KERN_RESOURCE_SHORTAGE; } nd->port = port; @@ -582,7 +582,6 @@ device_open (ipc_port_t reply_port, mach ipc_port_nsrequest (nd->port, 1, notify, ¬ify); assert (notify == IP_NULL); -out: if (IP_VALID (reply_port)) ds_device_open_reply (reply_port, reply_port_type, D_SUCCESS, dev_to_port(nd)); else