mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
DUID-LL Generator fix
Timestamp is not used for DUID-LL only mac address.
This commit is contained in:
parent
063bd90e86
commit
59ec7b7449
@ -64,12 +64,8 @@ function generate_new_duid($duid_type)
|
||||
}
|
||||
$new_duid = $new_duid.':'.$timestamp.':'.$mac;
|
||||
break;
|
||||
case '2': //LL
|
||||
$ts = time() - 946684800;
|
||||
$hts = dechex($ts);
|
||||
$timestamp = sprintf("%s",$hts);
|
||||
$timestamp_array = str_split($timestamp,2);
|
||||
$timestamp = implode(":",$timestamp_array);
|
||||
case '2': //LL - NO TIMESTAMP: Just 00:03:00:01: + Link layer address in canonical form, so says RFC.
|
||||
$mac = get_mac_address(getenv('REMOTE_ADDR'));
|
||||
$type = "\x00\x03\x00\x01";
|
||||
for ($count = 0; $count < strlen($type); ) {
|
||||
$new_duid .= bin2hex( $type[$count]);
|
||||
@ -78,7 +74,7 @@ function generate_new_duid($duid_type)
|
||||
$new_duid .= ':';
|
||||
}
|
||||
}
|
||||
$new_duid = $new_duid.':'.$timestamp;
|
||||
$new_duid = $new_duid.':'.$mac;
|
||||
break;
|
||||
case '3': //UUID
|
||||
$type = "\x00\x00\x00\x04".openssl_random_pseudo_bytes(16);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user