mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-31 08:25:38 +00:00
For forward compatibility, add minimal parse for some future physical address types.
This commit is contained in:
parent
d2b1dfe424
commit
3ce5ad9e2c
@ -409,6 +409,16 @@ struct InetAddress : public sockaddr_storage
|
||||
switch(b[p++]) {
|
||||
case 0:
|
||||
return 1;
|
||||
case 0x01:
|
||||
// TODO: Ethernet address (but accept for forward compatibility)
|
||||
return 7;
|
||||
case 0x02:
|
||||
// TODO: Bluetooth address (but accept for forward compatibility)
|
||||
return 7;
|
||||
case 0x03:
|
||||
// TODO: Other address types (but accept for forward compatibility)
|
||||
// These could be extended/optional things like AF_UNIX, LTE Direct, shared memory, etc.
|
||||
return (unsigned int)(b.template at<uint16_t>(p) + 3); // other addresses begin with 16-bit non-inclusive length
|
||||
case 0x04:
|
||||
ss_family = AF_INET;
|
||||
memcpy(&(reinterpret_cast<struct sockaddr_in *>(this)->sin_addr.s_addr),b.field(p,4),4); p += 4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user