Age | Commit message (Collapse) | Author |
|
|
|
Fix payload buffer to end at actual payload end. UDP header length includes the 8 bytes of the header so we do not want the +8 at the end of the buffer.
Signed-off-by: noiz <noiz@users.noreply.github.com>
Co-authored-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
* Adding support for Ciena DHCPv4
Signed-off-by: Emanuele Fia <name29@fb.com>
|
|
Signed-off-by: noiz <noiz@users.noreply.github.com>
|
|
empty (#444)
* Adding check for empty serial number in opt 61
|
|
As described in RFC8357 this is a 0-length suboption used to indicate
that the relay supports the arbitrary UDP port behavior from RFC8357
Since this is 0-length the constant is enough to handle the full
behavior
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
* Adding support to parse vendor data for cisco firepower
|
|
|
|
u-root -> dhcp -> u-root is the circular dependency. Which is fine,
except we messed up modules in u-root big time. We need to break the
circular dep for now.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
|
|
* Add dhcp Opt 124(vivc) parsing to ztp
Signed-off-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
|
|
Signed-off-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
Co-authored-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
|
|
* Adding xe interface format for Juniper qfx to list of circuit regexes
Signed-off-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
* Consolidating regexes for et and xe into one entry
Signed-off-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
Co-authored-by: Hariharakumar Narasimhakumar <hhkumar@fb.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Ensure server identifier matches the offer server identifier when
looking for ACKs or NAKs.
This protects against rogue DHCP servers NAKing requests the shouldn't.
Signed-off-by: Moritz Fischer <moritzf@google.com>
Co-authored-by: Moritz Fischer <moritzf@google.com>
|
|
Signed-off-by: Eugene Burkov <e.burkov@adguard.com>
|
|
Signed-off-by: Marcel Moolenaar <mmoolena@amazon.com>
|
|
RFC 2131 gives two examples of padding in section 4.1. For both the
examples, the 'end' option preceeds the padding with the 'pad' option.
These examples relate to overloading pre-defined fields for options,
not padding the packet for a minimal size.
Older versions of the U-Boot firmware support DHCP, but do not expect
the 'pad' option. The firmware logs the following warning for each
occurence:
*** Unhandled DHCP Option in OFFER/ACK: 0
This warning disappears when the 'end' option preceeds the 'pad'
option.
Signed-off-by: Marcel Moolenaar <mmoolena@amazon.com>
|
|
Signed-off-by: yaocw2020 <yaocanwu@gmail.com>
|
|
to raiSubOptionCode
- a few minor changes to address latest feedback
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
|
|
For any users to write their own Discover or Request methods, they need
access to the ifaceHWAddr and serverAddr.
Discovered while trying to move pinterest/bender to nclients.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
- add raiValue in option_relay_agent_information.go to implement fmt.Stringer
- change test cases accordingly
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- add a space in OptionGeneric.String()
- move the indenting "\n" from OptionHumanizer.Stringify to RelayOptions.String()
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- update OptionHumanizer.Stringify so it include an additional newline for option82
- update OptionGeneric.String so it include a string output in addition to existing byte slice output
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- add NewReleaseFromLease and update Client.Release() accordingly
- update lease_test.go accordingly
- remove example_lease_test.go
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- fix a data race in lease_test.go
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- update lease_test.go make sure server side error is caught
- some minor fixes based on PR discussion
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- change Client.Request so it now only return Lease
- change test case and example accordingly
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
testing
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
which now returns a lease instead of ack
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- update example_lease_test.go accordingly
- add lease_test.go, which contain some test cases for lease&release, using socketpair
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
dhcpv4_release
|
|
When parsing a route option with a mask size >32, there would be a panic
at option_routes.go:47 as user-supplied data is used without
verification for a slice bound, causing a read of masksize/8, whic is
possibly >4 bytes. Instead reject the invalid route
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
When there was a 0-length generic option, it would be omitted.
Rapid commit (option 80) is a 0-length option with a length tag.
There could also be 0-length options in the vendor extensions, and the
RFC states that they should be written out:
> Any options defined subsequent to this document should contain a
> length octet even if the length is fixed or zero.
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
There is a special case for when ClientHwAddr is empty, which seems to
only apply when creating a packet with New(), which defaults to
HWType==Ethernet but doesn't assign the ClientHwAddr field.
All the other New*() constructors assign a hardware address and don't
use this codepath
Remove this special case and instead make New() generate an
almost-correct packet in the first place, so that ToBytes() can stay
more generic
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
When BootFileName is longer than 128 bytes or ServerHostName is longer
than 64 bytes, trying to null-terminate the strings when writing out the
packet causes a panic.
Since the ToBytes() function cannot return errors, silently truncate the
string instead (we do the same with ClientHWAddr if it is longer than 16
bytes for example)
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
Those 2 tests did the exact same thing: check that an invalid packet
raises an error when parsed. Merge them into the same test, so that we
can easily add more test cases to the list
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|
|
Signed-off-by: Anatole Denis <natolumin@unverle.fr>
|