diff options
author | Sean Karlage <skarlage@fb.com> | 2018-07-29 17:54:30 -0700 |
---|---|---|
committer | Sean Karlage <skarlage@fb.com> | 2018-07-30 22:17:49 -0700 |
commit | 7319b8f8a1a601b5e69c5bcaa33914c0f85b92e6 (patch) | |
tree | 945d12ed3d8a11ebc55dd2f8d6ee1304ecd2b20f /netboot | |
parent | c6894ea160d82b4a326ebab94faaebd090192a7b (diff) |
DHCPv6: Rename Option constants to CamelCase
To appease linters
Diffstat (limited to 'netboot')
-rw-r--r-- | netboot/netboot.go | 4 | ||||
-rw-r--r-- | netboot/netconf.go | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/netboot/netboot.go b/netboot/netboot.go index 643c5ec..81ba144 100644 --- a/netboot/netboot.go +++ b/netboot/netboot.go @@ -67,7 +67,7 @@ func ConversationToNetconf(conversation []dhcpv6.DHCPv6) (*NetConf, string, erro opt dhcpv6.Option bootfile string ) - opt = reply.GetOneOption(dhcpv6.OPT_BOOTFILE_URL) + opt = reply.GetOneOption(dhcpv6.OptionBootfileURL) if opt == nil { log.Printf("no bootfile URL option found in REPLY, looking for it in ADVERTISE") // as a fallback, look for bootfile URL in the advertise @@ -82,7 +82,7 @@ func ConversationToNetconf(conversation []dhcpv6.DHCPv6) (*NetConf, string, erro if advertise == nil { return nil, "", errors.New("no ADVERTISE found") } - opt = advertise.GetOneOption(dhcpv6.OPT_BOOTFILE_URL) + opt = advertise.GetOneOption(dhcpv6.OptionBootfileURL) if opt == nil { return nil, "", errors.New("no bootfile URL option found in ADVERTISE") } diff --git a/netboot/netconf.go b/netboot/netconf.go index f7a117c..84fb263 100644 --- a/netboot/netconf.go +++ b/netboot/netconf.go @@ -30,7 +30,7 @@ type NetConf struct { // GetNetConfFromPacketv6 extracts network configuration information from a DHCPv6 // Reply packet and returns a populated NetConf structure func GetNetConfFromPacketv6(d *dhcpv6.DHCPv6Message) (*NetConf, error) { - opt := d.GetOneOption(dhcpv6.OPTION_IA_NA) + opt := d.GetOneOption(dhcpv6.OptionIANA) if opt == nil { return nil, errors.New("No option IA NA found") } @@ -39,7 +39,7 @@ func GetNetConfFromPacketv6(d *dhcpv6.DHCPv6Message) (*NetConf, error) { oiana := opt.(*dhcpv6.OptIANA) iaaddrs := make([]*dhcpv6.OptIAAddress, 0) for _, o := range oiana.Options { - if o.Code() == dhcpv6.OPTION_IAADDR { + if o.Code() == dhcpv6.OptionIAAddr { iaaddrs = append(iaaddrs, o.(*dhcpv6.OptIAAddress)) } } @@ -55,7 +55,7 @@ func GetNetConfFromPacketv6(d *dhcpv6.DHCPv6Message) (*NetConf, error) { }) } // get DNS configuration - opt = d.GetOneOption(dhcpv6.DNS_RECURSIVE_NAME_SERVER) + opt = d.GetOneOption(dhcpv6.OptionDNSRecursiveNameServer) if opt == nil { return nil, errors.New("No option DNS Recursive Name Servers found ") } @@ -63,7 +63,7 @@ func GetNetConfFromPacketv6(d *dhcpv6.DHCPv6Message) (*NetConf, error) { // TODO should this be copied? netconf.DNSServers = odnsserv.NameServers - opt = d.GetOneOption(dhcpv6.DOMAIN_SEARCH_LIST) + opt = d.GetOneOption(dhcpv6.OptionDomainSearchList) if opt == nil { return nil, errors.New("No option DNS Domain Search List found") } |