From 0405526172c87e4fc75325c9a195834a8fb4ba94 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Thu, 14 Jul 2022 14:52:58 +0300 Subject: dhcpv4: enable deletion of options and add modifier for it Signed-off-by: Dennis Marttinen --- dhcpv4/options.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dhcpv4/options.go') diff --git a/dhcpv4/options.go b/dhcpv4/options.go index fdc79ae..9d404b4 100644 --- a/dhcpv4/options.go +++ b/dhcpv4/options.go @@ -81,6 +81,11 @@ func (o Options) Has(opcode OptionCode) bool { return ok } +// Del deletes the option matching the option code. +func (o Options) Del(opcode OptionCode) { + delete(o, opcode.Code()) +} + // Update updates the existing options with the passed option, adding it // at the end if not present already func (o Options) Update(option Option) { -- cgit v1.2.3