- }
-
- /* Check that the interface we've got is the kind we expect */
- if ((dia->dl_sap_length != 2 && dia->dl_sap_length != -2) ||
- dia->dl_service_mode != DL_CLDLS || dia->dl_addr_length != ETHERADDRL + 2 ||
- dia->dl_brdcst_addr_length != ETHERADDRL)
- {
- zlog_warn ("%s: unsupported interface type for %s", __func__,
- circuit->interface->name);
- close (fd);
- return ISIS_WARNING;
- }
- switch (dia->dl_mac_type)
- {
- case DL_CSMACD:
- case DL_ETHER:
- case DL_100VG:
- case DL_100VGTPR:
- case DL_ETH_CSMA:
- case DL_100BT:
- break;
- default:
- zlog_warn ("%s: unexpected mac type on %s: %lld", __func__,
- circuit->interface->name, (long long)dia->dl_mac_type);
- close (fd);
- return ISIS_WARNING;
- }
-
- circuit->sap_length = dia->dl_sap_length;
-
- /*
- * The local hardware address is something that should be provided by way of
- * sockaddr_dl for the interface, but isn't on Solaris. We set it here based
- * on DLPI's reported address to avoid roto-tilling the world.
- * (Note that isis_circuit_if_add on Solaris doesn't set the snpa.)
- *
- * Unfortunately, GLD is broken and doesn't provide the address after attach,
- * so we need to be careful and use DL_PHYS_ADDR_REQ instead.
- */
- if (dlpiaddr (fd, circuit->u.bc.snpa) == -1)
- {
- zlog_warn ("open_dlpi_dev(): interface %s: unable to get MAC address",
- circuit->interface->name);
- close (fd);
- return ISIS_WARNING;
- }
-
- /* Now bind to SAP 0. This gives us 802-type traffic. */
- if (dlpibind (fd) == -1)
- {
- zlog_warn ("%s: cannot bind SAP 0 on %s", __func__,
- circuit->interface->name);
- close (fd);
- return ISIS_WARNING;
- }
-
- /*
- * Join to multicast groups according to
- * 8.4.2 - Broadcast subnetwork IIH PDUs
- */
- retval = 0;
- retval |= dlpimcast (fd, ALL_L1_ISS);
- retval |= dlpimcast (fd, ALL_ISS);
- retval |= dlpimcast (fd, ALL_L2_ISS);
-
- if (retval != 0)
- {
- zlog_warn ("%s: unable to join multicast on %s", __func__,
- circuit->interface->name);
- close (fd);
- return ISIS_WARNING;
- }
-
- /* Push on the packet filter to avoid stray 802 packets */
- if (ioctl (fd, I_PUSH, "pfmod") == 0)
- {
- struct packetfilt pfil;
- struct strioctl sioc;
-
- pfil.Pf_Priority = 0;
- pfil.Pf_FilterLen = sizeof (pf_filter) / sizeof (u_short);
- memcpy (pfil.Pf_Filter, pf_filter, sizeof (pf_filter));
- /* pfmod does not support transparent ioctls */
- sioc.ic_cmd = PFIOCSETF;
- sioc.ic_timout = 5;
- sioc.ic_len = sizeof (struct packetfilt);
- sioc.ic_dp = (char *)&pfil;
- if (ioctl (fd, I_STR, &sioc) == -1)
- zlog_warn("%s: could not perform PF_IOCSETF on %s",
- __func__, circuit->interface->name);
- }
-
- circuit->fd = fd;
-
- return ISIS_OK;
+ switch (dia->dl_mac_type) {
+ case DL_CSMACD:
+ case DL_ETHER:
+ case DL_100VG:
+ case DL_100VGTPR:
+ case DL_ETH_CSMA:
+ case DL_100BT:
+ break;
+ default:
+ zlog_warn("%s: unexpected mac type on %s: %lld", __func__,
+ circuit->interface->name,
+ (long long)dia->dl_mac_type);
+ close(fd);
+ return ISIS_WARNING;
+ }
+
+ circuit->sap_length = dia->dl_sap_length;
+
+ /*
+ * The local hardware address is something that should be provided by
+ * way of
+ * sockaddr_dl for the interface, but isn't on Solaris. We set it here
+ * based
+ * on DLPI's reported address to avoid roto-tilling the world.
+ * (Note that isis_circuit_if_add on Solaris doesn't set the snpa.)
+ *
+ * Unfortunately, GLD is broken and doesn't provide the address after
+ * attach,
+ * so we need to be careful and use DL_PHYS_ADDR_REQ instead.
+ */
+ if (dlpiaddr(fd, circuit->u.bc.snpa) == -1) {
+ zlog_warn(
+ "open_dlpi_dev(): interface %s: unable to get MAC address",
+ circuit->interface->name);
+ close(fd);
+ return ISIS_WARNING;
+ }
+
+ /* Now bind to SAP 0. This gives us 802-type traffic. */
+ if (dlpibind(fd) == -1) {
+ zlog_warn("%s: cannot bind SAP 0 on %s", __func__,
+ circuit->interface->name);
+ close(fd);
+ return ISIS_WARNING;
+ }
+
+ /*
+ * Join to multicast groups according to
+ * 8.4.2 - Broadcast subnetwork IIH PDUs
+ */
+ retval = 0;
+ retval |= dlpimcast(fd, ALL_L1_ISS);
+ retval |= dlpimcast(fd, ALL_ISS);
+ retval |= dlpimcast(fd, ALL_L2_ISS);
+
+ if (retval != 0) {
+ zlog_warn("%s: unable to join multicast on %s", __func__,
+ circuit->interface->name);
+ close(fd);
+ return ISIS_WARNING;
+ }
+
+ /* Push on the packet filter to avoid stray 802 packets */
+ if (ioctl(fd, I_PUSH, "pfmod") == 0) {
+ struct packetfilt pfil;
+ struct strioctl sioc;
+
+ pfil.Pf_Priority = 0;
+ pfil.Pf_FilterLen = sizeof(pf_filter) / sizeof(unsigned short);
+ memcpy(pfil.Pf_Filter, pf_filter, sizeof(pf_filter));
+ /* pfmod does not support transparent ioctls */
+ sioc.ic_cmd = PFIOCSETF;
+ sioc.ic_timout = 5;
+ sioc.ic_len = sizeof(struct packetfilt);
+ sioc.ic_dp = (char *)&pfil;
+ if (ioctl(fd, I_STR, &sioc) == -1)
+ zlog_warn("%s: could not perform PF_IOCSETF on %s",
+ __func__, circuit->interface->name);
+ }
+
+ circuit->fd = fd;
+
+ return ISIS_OK;