summaryrefslogtreecommitdiffhomepage
path: root/examples/packetcrafting6/main.go
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2019-03-04 12:47:50 -0800
committerinsomniac <insomniacslk@users.noreply.github.com>2019-04-04 12:49:08 +0100
commit175868d67987770d2d729186f7676e0b98f925df (patch)
tree2d56b1cb28fddd14ad935fa3c41dcc368b31e30c /examples/packetcrafting6/main.go
parentb40bd52ae58aee37cec9ef81008e24488350c98f (diff)
client6: new async DHCPv6 client like #250.
- Race-condition-averse. - Supports multiple concurrent requests. - Tested. - Requires a fully compatible net.PacketConn. Signed-off-by: Christopher Koch <chrisko@google.com>
Diffstat (limited to 'examples/packetcrafting6/main.go')
-rw-r--r--examples/packetcrafting6/main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/packetcrafting6/main.go b/examples/packetcrafting6/main.go
index 7e2fb1b..f2c1855 100644
--- a/examples/packetcrafting6/main.go
+++ b/examples/packetcrafting6/main.go
@@ -15,9 +15,14 @@ func main() {
// that implement the `dhcpv6.DHCPv6` interface.
// Then print the wire-format representation of the packet.
+ iface, err := net.InterfaceByName("eth0")
+ if err != nil {
+ log.Fatal(err)
+ }
+
// Create the DHCPv6 Solicit first, using the interface "eth0"
// to get the MAC address
- msg, err := dhcpv6.NewSolicitForInterface("eth0")
+ msg, err := dhcpv6.NewSolicit(iface.HardwareAddr)
if err != nil {
log.Fatal(err)
}