Add local only checking for ipv4
This commit is contained in:
parent
3be35fd803
commit
004aad9b3b
1 changed files with 5 additions and 3 deletions
|
@ -152,9 +152,11 @@ fn parse_mdns_response(response: []u8, ip_info: util.IPInfo) !util.IP {
|
|||
continue;
|
||||
}
|
||||
if (ip_len == 4) {
|
||||
var addr_buff = [_]u8{0x00} ** 4;
|
||||
@memcpy(&addr_buff, ip_bytes);
|
||||
addr = std.net.Address.initIp4(addr_buff, 0);
|
||||
if (ip_bytes[0] == 192 and ip_bytes[1] == 168) {
|
||||
var addr_buff = [_]u8{0x00} ** 4;
|
||||
@memcpy(&addr_buff, ip_bytes);
|
||||
addr = std.net.Address.initIp4(addr_buff, 0);
|
||||
}
|
||||
} else if (ip_len == 16) {
|
||||
if (ip_bytes[0] == 0xfd) {
|
||||
var addr_buff = [_]u8{0x00} ** 16;
|
||||
|
|
Loading…
Reference in a new issue