summaryrefslogtreecommitdiffhomepage
path: root/examples/packetcrafting6/main.go
diff options
context:
space:
mode:
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)
}