summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/modifiers.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2019-05-09 10:43:57 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2019-05-09 11:05:53 +0100
commit03d4490e455095ffc8d8800b5e56ee11f4cbbde7 (patch)
treec60cb228a951cdef63fb8ea6f64e07e1a415f233 /dhcpv4/modifiers.go
parent15b76eb439c6abab393a9f129239623642e10444 (diff)
NewReplyFromRequest: copy gw ip
Diffstat (limited to 'dhcpv4/modifiers.go')
-rw-r--r--dhcpv4/modifiers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/dhcpv4/modifiers.go b/dhcpv4/modifiers.go
index 477f48f..16d1d57 100644
--- a/dhcpv4/modifiers.go
+++ b/dhcpv4/modifiers.go
@@ -36,6 +36,13 @@ func WithServerIP(ip net.IP) Modifier {
}
}
+// WithGatewayIP sets the Gateway IP for the DHCPv4 packet.
+func WithGatewayIP(ip net.IP) Modifier {
+ return func(d *DHCPv4) {
+ d.GatewayIPAddr = ip
+ }
+}
+
// WithReply fills in opcode, hwtype, xid, clienthwaddr, flags, and gateway ip
// addr from the given packet.
func WithReply(request *DHCPv4) Modifier {