00:19:19 I wonder why illumos is the only OS (as far as I managed to test, anyway) that implements getifaddrs() and for Ethernet interfaces returns AF_LINK addresses with sdl_type set to 0 instead of IFT_ETHER 00:19:58 https://github.com/the-tcpdump-group/libpcap/blob/master/testprogs/findalldevstest.c#L340 00:21:43 is there any explanation why this would be the intended behaviour? 00:22:30 Feels more likely just a bug? 00:23:51 from my point of view, yes, but I decided to ask first 00:24:06 I'm just looking at the source and there's nothing obvious there. 00:24:13 Support for AF_LINK was added relatively recently to getifaddrs(). 00:24:16 I know how it feels 00:25:07 It wasn't immediately in the information we were grabbing to fill in that field. 00:26:08 It was set on the ifi_type for that case on the higher level ifaddr structure. 00:26:12 does the kernel have enough internal information about the interfaces to derive sdl_type from? 00:26:19 So I think it'd likely be a similar operation here. 00:26:23 Yeah, it should 00:26:38 We do when getting it from other ways, but getifaddrs() isn't a kernel thing. 00:26:44 It's just going through info from different sources. 00:27:10 I do not know if illumos implements SIOCGIFTYPE, but that in theory should feed from the same internal interface type 00:27:49 I mean, we have this info in the ifi_type, so it should just be another assignment, if I'm reading this correctly. 00:28:46 We don't have anything by that name (but neither does FreeBSD). 00:29:28 I suppose at least IFT_ETHER and IFT_LOOP from /usr/include/net/if_types.h should have a purpose 00:29:45 although for the loopback getifaddrs() does not return an AF_LINK address 00:30:02 That's correct because there is no layer 2 address for it. 00:30:14 alright, I am opening a bug report then? 00:30:38 Sure. If you do, let me know and I can add some more specifics. Or I can write something up. 00:31:09 would "lib" or "networking" be the correct category? 00:32:27 Either is fine. Don't sweat it. 00:32:50 I'm going to have to step afk, so leave me a note of the bug id and I can add more specifics about whta's required to be filled in. 00:33:05 Though I do wonder if it would be better to try libdlpi here, though that's probably more of a pain. 00:45:48 rmustacc: https://www.illumos.org/issues/16383 00:45:50 → BUG 16383: getifaddrs() returns AF_LINK addresses with sockaddr_dl.sdl_type == 0 (New) 00:48:13 thank you for the comments 00:51:42 for packet capture DLPI used to be the interface of choice on older Solaris versions, then at some point Solaris grew BPF, which libpcap started to use instead 00:54:48 for interface enumeration it used to be SIOCGIFCONF for very old Unixes, probably including SunOS, then Solaris developed SIOCGLIFCONF, which served the purpose on Solaris 10 and probably before, then Solaris 11 developed getifaddrs() 00:55:43 so illumos inherited the BPF+getifaddrs() combination, which is one of the most popular 00:57:45 there is quite a bit of DLPI-specific code, but now it covers HP-UX only, and if there is a need to adapt it to another OS, there would be a risk of breaking HP-UX 01:05:38 Thanks for filing that. I've followed up with the note about what I think the fix is likely. 01:13:08 the illumos getifaddrs is largely built on top of SIOCGLIFCONF 01:22:38 is there a meaningful advantage of one over another or it is just a BSD/SystemV difference? 01:25:30 all of the SIOCG*IF* socket ioctls are complicated & fussy. SIOCGIFCONF wasn't a good match for what solaris had in its stack, especially with the addition of IPv6 01:25:57 so getifaddrs() hides the mess so only the library maintainer has to muck with it. 01:31:21 in libpcap getifaddrs() is the first choice, then SIOCGLIFCONF, then SIOCGIFCONF: https://github.com/the-tcpdump-group/libpcap/blob/master/configure.ac#L1162 01:35:37 it is difficult to tell immediately whether it would make more sense to prefer SIOCGLIFCONF, but at least one useful side effect is discovering a bug in getifaddrs() 01:36:57 this currently applies to Solaris 10 only: https://github.com/the-tcpdump-group/libpcap/blob/master/fad-glifc.c 01:37:42 anyway, thank you for the comments, it is becoming late in this corner of the Internet, I will be back tomorrow 01:47:34 I think preferring getifaddrs() makes sense in almost all cases. 10:18:35 I tried sharing physical drive over iSCSI from SmartOS host (p0) and linux machine doesn't see it and Windows iSCSI sees it and target but in disk management con't see partitions bt trats it as unformatted. 10:35:29 nikolam: does it look unformatted in SmartOS too? 10:37:13 Denis, nope, look allright, in format/fdisk, like 1 Ntfs partition on drive. 10:37:28 well, then I don't know 10:37:58 is the size at least the same at both ends? 10:42:46 Denis, what size. physical disk block size? I tried also today to set it on 512 was before 4096 exported and nothing changes, like, windows treats iscsi target as unformatted 10:42:51 nikolam: show the output of stmfadm list-lu -v 10:43:46 I had the exact disk size in bytes in mind, just to make sure it is the right lot of bytes that is being fed into iSCSI 10:44:13 denk, https://bpa.st/PZKQ 10:44:46 nikolam: you should recreate it and use metafile 10:45:02 otherwise the metadata will be placed into the data file 10:45:08 ah. metafile 10:45:34 it uses for about 64k 10:46:22 /dev/rdsk/c1t1d0p0 means a partition on the disk, doesn't it? 10:46:42 looking for a manual for metafile.. p0 should be the whole drive 10:46:48 the disk would be /dev/rdsk/c1t1d0, AFAIR, and the sizes would be different 10:47:08 but perhaps you know better 10:54:29 nikolam: also disable writeback cache 10:55:16 denk, thankt, still look how to make the metafiel and docs on it 10:55:19 thanks 10:57:20 stmfadm create-lu -pmeta=/path/to/meta.file -pblk= -pserail=MySerial -pwcd=true /dev/rdsk/ 10:57:38 meta.file should exist 10:57:53 for example, touch /var/tmp/meta.file 10:58:07 wow I see thanks 10:58:37 probably you have corrupted the data on the device 10:59:02 don't forget about 64k of the metadata 10:59:50 anyway, you have been warned some time ago about second chance to fail :) 11:00:28 second chance to fail? :P 11:00:46 with zfs and snapshots 11:01:11 you choosen direct device 11:01:29 Ah ok :P data integrity. No sweat in this case 11:18:45 now with /var/tmp/meta.file is sees the drive wight in iscsi on windows. Without -pserail=MySerial , Will see about disabling writeback cache 11:20:53 wcd can be modified by modify-lu subcommand 11:21:26 stmfadm modify-lu -pwcd=true 11:23:45 wow I should be really reading more man pages. many thanks denk 11:24:59 will reboot to see how it it going on in real windows , thank you 12:36:22 sommerfeld: rmustacc: found another bug in getifaddrs(), filed as #16384 17:19:58 rmustacc: re DLPI, libpcap uses it on Solaris 10 for packet capture, but it would be only compile-testable with the current resources 17:21:20 also, re AF_LINK on the loopback interface, the semantics in other OSes that do it is to set sdl_alen to 0, then the purpose of sockaddr_dl is to convey the interface type and index