Skip to content

Commit

Permalink
closes #320 enable LinuxMACFetcher on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Jan 16, 2022
1 parent 70e5397 commit 417f10f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG
@@ -1,10 +1,10 @@
Changes in 3.8.0:
- Support for Mac M1 (provided that it runs an arm64 build of Java) - thanks to @aplr #284
- SWT updated for all platforms
- Java 11 is now the minimum required (due to SWT)
- Source can be built with Java 17
- Java 11 is now the minimum required (due to SWT), source can now be built with Java 17
- If real network netmask is known (e.g. LAN), then skipping of broadcast addresses will respect that instead of always skipping .0 and .255 #309
- Pressing IP^ button to prefill local network interfaces will now set netmask in Range Feeder
- LinuxMACFetcher will now read Kernel ARP table directly, not relying on the arp utility to be available #320
- Mac vendors updated

Changes in 3.7.6:
Expand Down
3 changes: 2 additions & 1 deletion src/net/azib/ipscan/config/ComponentRegistry.java
Expand Up @@ -43,7 +43,8 @@ public void register(Injector i) throws Exception {
i.register(TXTExporter.class, CSVExporter.class, XMLExporter.class, IPListExporter.class);

i.register(IPFetcher.class, PingFetcher.class, PingTTLFetcher.class, HostnameFetcher.class, PortsFetcher.class);
i.register(MACFetcher.class, (MACFetcher) Class.forName(MACFetcher.class.getPackage().getName() + (Platform.WINDOWS ? ".WinMACFetcher" : ".UnixMACFetcher")).newInstance());
i.register(MACFetcher.class, (MACFetcher) Class.forName(MACFetcher.class.getPackage().getName() +
(Platform.WINDOWS ? ".WinMACFetcher" : Platform.LINUX ? ".LinuxMACFetcher" : ".UnixMACFetcher")).newInstance());
i.register(CommentFetcher.class, FilteredPortsFetcher.class, WebDetectFetcher.class, HTTPSenderFetcher.class,
NetBIOSInfoFetcher.class, PacketLossFetcher.class, HTTPProxyFetcher.class, MACVendorFetcher.class);
i.register(FeederRegistry.class, i.require(FeederGUIRegistry.class));
Expand Down
2 changes: 1 addition & 1 deletion src/net/azib/ipscan/fetchers/LinuxMACFetcher.java
Expand Up @@ -28,7 +28,7 @@ private static Stream<String> arpLines() {
@Override public String resolveMAC(InetAddress address) {
try {
String ip = address.getHostAddress();
return arpLines().filter(line -> line.startsWith(ip)).findFirst()
return arpLines().filter(line -> line.startsWith(ip + " ")).findFirst()
.map(line -> line.substring(macIndex, macIndex + macLength).toUpperCase())
.filter(mac -> !unavailableMac.equals(mac))
.orElse(getLocalMAC(address));
Expand Down

0 comments on commit 417f10f

Please sign in to comment.