mirror of
https://github.com/mdlayher/homelab.git
synced 2024-12-14 11:47:32 +00:00
nixos/lib/vargen: bump inet.af/netaddr, use new API
Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
parent
908bb1db2e
commit
b459b61a05
3 changed files with 12 additions and 12 deletions
|
@ -4,5 +4,5 @@ go 1.14
|
|||
|
||||
require (
|
||||
github.com/mdlayher/eui64 v0.0.0-20191004205636-300b7bde793c
|
||||
inet.af/netaddr v0.0.0-20200425195807-ed91f5d53cc9
|
||||
inet.af/netaddr v0.0.0-20200512140312-d37a9e0a2dd4
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
github.com/mdlayher/eui64 v0.0.0-20191004205636-300b7bde793c h1:758I75uwYgVtX8fzyn0dvHQEUGNA60284ujMT7a0q2Y=
|
||||
github.com/mdlayher/eui64 v0.0.0-20191004205636-300b7bde793c/go.mod h1:1Po4lSpd7AjxFUNZbEut0MJQ4gT4MDn2ZuBiNfitUDI=
|
||||
inet.af/netaddr v0.0.0-20200425195807-ed91f5d53cc9 h1:UtE0zzcV/h1n5gUsYwK5IWHXF85HZoWhhVzuc8ZxSAQ=
|
||||
inet.af/netaddr v0.0.0-20200425195807-ed91f5d53cc9/go.mod h1:qqYzz/2whtrbWJvt+DNWQyvekNN4ePQZcg2xc2/Yjww=
|
||||
inet.af/netaddr v0.0.0-20200512140312-d37a9e0a2dd4 h1:2Lj2bqi5EmgZSyJSaLoniH93rP/IhuWr6BTdgAJuiYA=
|
||||
inet.af/netaddr v0.0.0-20200512140312-d37a9e0a2dd4/go.mod h1:qqYzz/2whtrbWJvt+DNWQyvekNN4ePQZcg2xc2/Yjww=
|
||||
|
|
|
@ -167,26 +167,26 @@ func newInterface(s subnet) iface {
|
|||
}
|
||||
|
||||
// Router always has a .1 or ::1 suffix.
|
||||
ip4 := s.IPv4.IPNet().IP
|
||||
ip4[3] = 1
|
||||
ip4 := s.IPv4.IP.As16()
|
||||
ip4[15] = 1
|
||||
|
||||
gua := s.IPv6.GUA.IPNet().IP
|
||||
gua := s.IPv6.GUA.IP.As16()
|
||||
gua[15] = 1
|
||||
|
||||
ula := s.IPv6.ULA.IPNet().IP
|
||||
ula := s.IPv6.ULA.IP.As16()
|
||||
ula[15] = 1
|
||||
|
||||
lla := s.IPv6.LLA.IPNet().IP
|
||||
lla := s.IPv6.LLA.IP.As16()
|
||||
lla[15] = 1
|
||||
|
||||
return iface{
|
||||
Name: s.Name,
|
||||
InternalDomain: internal,
|
||||
IPv4: mustStdIP(ip4),
|
||||
IPv4: netaddr.IPFrom16(ip4),
|
||||
IPv6: ipv6Addresses{
|
||||
GUA: mustStdIP(gua),
|
||||
ULA: mustStdIP(ula),
|
||||
LLA: mustStdIP(lla),
|
||||
GUA: netaddr.IPFrom16(gua),
|
||||
ULA: netaddr.IPFrom16(ula),
|
||||
LLA: netaddr.IPFrom16(lla),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue