Index: stand/common/dev_net.c =================================================================== --- stand/common/dev_net.c (revision 342577) +++ stand/common/dev_net.c (working copy) @@ -72,7 +72,7 @@ int debug = 0; #endif -static char *netdev_name; +static int netdev_current_unit = -1; static int netdev_sock = -1; static int netdev_opens; @@ -122,15 +122,15 @@ { struct iodesc *d; va_list args; - char *devname; /* Device part of file name (or NULL). */ + struct devdesc *dev; int error = 0; va_start(args, f); - devname = va_arg(args, char*); + dev = va_arg(args, struct devdesc*); va_end(args); /* Before opening another interface, close the previous one first. */ - if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) + if (netdev_sock >= 0 && dev->d_unit != netdev_current_unit) net_cleanup(); /* On first open, do netif open, mount, etc. */ @@ -137,12 +137,12 @@ if (netdev_opens == 0) { /* Find network interface. */ if (netdev_sock < 0) { - netdev_sock = netif_open(devname); + netdev_sock = netif_open(dev); if (netdev_sock < 0) { printf("net_open: netif_open() failed\n"); return (ENXIO); } - netdev_name = strdup(devname); + netdev_current_unit = dev->d_unit; #ifdef NETIF_DEBUG if (debug) printf("net_open: netif_open() succeeded\n"); @@ -157,7 +157,7 @@ error = net_getparams(netdev_sock); if (error) { /* getparams makes its own noise */ - free(netdev_name); + netdev_current_unit = -1; netif_close(netdev_sock); netdev_sock = -1; return (error); @@ -218,7 +218,7 @@ printf("net_cleanup: calling netif_close()\n"); #endif rootip.s_addr = 0; - free(netdev_name); + netdev_current_unit = -1; netif_close(netdev_sock); netdev_sock = -1; } Index: stand/libsa/stand.h =================================================================== --- stand/libsa/stand.h (revision 342577) +++ stand/libsa/stand.h (working copy) @@ -182,7 +182,7 @@ char *f_rabuf; /* readahead buffer pointer */ size_t f_ralen; /* valid data in readahead buffer */ off_t f_raoffset; /* consumer offset in readahead buffer */ -#define SOPEN_RASIZE 512 +#define SOPEN_RASIZE 4096 }; #define SOPEN_MAX 64 Index: stand/ofw/libofw/devicename.c =================================================================== --- stand/ofw/libofw/devicename.c (revision 342577) +++ stand/ofw/libofw/devicename.c (working copy) @@ -114,6 +114,8 @@ } strcpy(idev->d_path, name); idev->dd.d_dev = dv; + idev->dd.d_unit = (int)handle; + idev->dd.d_opendata = NULL; if (dv->dv_type == DEVT_ZFS) { p = devspec + strlen(dv->dv_name); err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); Index: stand/ofw/libofw/ofw_net.c =================================================================== --- stand/ofw/libofw/ofw_net.c (revision 342577) +++ stand/ofw/libofw/ofw_net.c (working copy) @@ -177,7 +177,7 @@ #if defined(NETIF_DEBUG) { - struct ether_header *eh = ptr; + struct ether_header *eh = (void*)ptr; printf("dst: %s ", ether_sprintf(eh->ether_dhost)); printf("src: %s ", ether_sprintf(eh->ether_shost));