summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv4/nclient4/example_lease_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/dhcpv4/nclient4/example_lease_test.go b/dhcpv4/nclient4/example_lease_test.go
index 1d7d7a4..876a075 100644
--- a/dhcpv4/nclient4/example_lease_test.go
+++ b/dhcpv4/nclient4/example_lease_test.go
@@ -12,18 +12,18 @@ import (
func Example_dHCPv4ClientLease() {
ifname := "eth0"
- remote_id := "client-1"
+ remoteID := "client-1"
var idoptlist dhcpv4.OptionCodeList
//specify option82 is part of client identification used by DHCPv4 server
idoptlist.Add(dhcpv4.OptionRelayAgentInformation)
- clnt_options := []nclient4.ClientOpt{nclient4.WithClientIDOptions(idoptlist), nclient4.WithDebugLogger()}
- clnt, err := nclient4.New(ifname, clnt_options...)
+ clntOptions := []nclient4.ClientOpt{nclient4.WithClientIDOptions(idoptlist), nclient4.WithDebugLogger()}
+ clnt, err := nclient4.New(ifname, clntOptions...)
if err != nil {
log.Fatalf("failed to create dhcpv4 client,%v", err)
}
//adding option82/remote-id option to discovery and request
- remote_id_sub_opt := dhcpv4.OptGeneric(dhcpv4.AgentRemoteIDSubOption, []byte(remote_id))
- option82 := dhcpv4.OptRelayAgentInfo(remote_id_sub_opt)
+ remoteIDSubOpt := dhcpv4.OptGeneric(dhcpv4.AgentRemoteIDSubOption, []byte(remoteID))
+ option82 := dhcpv4.OptRelayAgentInfo(remoteIDSubOpt)
_, _, err = clnt.RequestSavingLease(context.Background(), dhcpv4.WithOption(option82))
if err != nil {
log.Fatal(err)