+enioctl(ifp, cmd, data)
+ register struct ifnet *ifp;
+ int cmd;
+ caddr_t data;
+{
+ register struct en_softc *es = ((struct en_softc *)ifp);
+ struct ifaddr *ifa = (struct ifaddr *) data;
+ int s = splimp(), error = 0;
+ struct endevice *enaddr;
+
+ switch (cmd) {
+
+ case SIOCSIFADDR:
+ enaddr = (struct endevice *)eninfo[ifp->if_unit]->ui_addr;
+ es->es_host = (~enaddr->en_addr) & 0xff;
+ /*
+ * Attempt to check agreement of protocol address
+ * and board address.
+ */
+ switch (ifa->ifa_addr.sa_family) {
+ case AF_INET:
+ if (in_lnaof(IA_SIN(ifa)->sin_addr) != es->es_host)
+ return (EADDRNOTAVAIL);
+ break;
+ }
+ ifp->if_flags |= IFF_UP;
+ if ((ifp->if_flags & IFF_RUNNING) == 0)
+ eninit(ifp->if_unit);
+ break;