JDK-4470026 : Add NetworkInterface.getHardwareAddress()
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-06-14
  • Updated: 2001-06-15
  • Resolved: 2001-06-15
Related Reports
Duplicate :  
Description

Name: bsC130419			Date: 06/14/2001


J2SE 1.4 beta documentation

Request
-------
Add NetworkInterface.getHardwareAddress()

This would return a byte array. Hardware addresses that don't fit into an even
number of bytes would be zero-padded. The actual contents of the byte array
would be undefined.

Rationale
---------
I use the hardware address of a machine's network interface as a hardware ID.
I use the hardware ID to machine-lock my software--something that Java
programmers will care about when they actually start writing commercial
software.

Currently, I do this by exec'ing an ipconfig/all or an ifconfig and parsing--
truly revolting, not to mention platform-specific.

Commentary
----------
Directly addressing the underlying issue (generating a hardware ID) might yield
a better solution. However, my solution is quick, and only mildly dirty.

Someone who understands network interfaces better than me might be able to
suggest a higher-level object for getHardwareAddress() to return.
(Review ID: 126591) 
======================================================================

Comments
WORK AROUND Name: bsC130419 Date: 06/14/2001 Exec an ipconfig/all or an ifconfig and parse. ======================================================================
11-06-2004

EVALUATION We are tracking the requirement to obtain the mac address in rfe 4143901. On many operating systems (including Solaris) it's necessary to be root to use the ioctls to obtain the hardware address of an interface. alan.bateman@ireland 2001-06-15
15-06-2001