Age | Commit message (Collapse) | Author |
|
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>
|
|
dhcpv4_release
|
|
- 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>
|
|
|
|
Signed-off-by: Chris Koch <chrisko@google.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>
|
|
dhcpv4_release
|
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684009
"Note that the dhcpv6 protocol doesn't have an option for a netmask. So
it is always /128 and routing is left to icmpv6 router advertisements."
RFC 5942 is a good read here as well:
An address could be acquired through the DHCPv6 identity association
for non- temporary addresses (IA_NA) option from [RFC3315] (which
does not include a prefix length), or through manual configuration
(if no prefix length is specified). The host incorrectly assumes an
invented prefix is on-link. This invented prefix typically is a /64
that was written by the developer of the operating system network
module API to any IPv6 application as a "default" prefix length when
a length isn't specified.
As DHCP developers, we *HAVE* to assume that no prefix is on-link. The
correct way to do that is to specify the netmask as /128.
The kernel will RA/RS their way around to figure out what prefixes are
indeed on-link.
Signed-off-by: Chris Koch <chrisko@google.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>
|
|
Signed-off-by: Hu Jun <hujun.work@gmail.com>
|
|
- fix a few more lint complains
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 Client Link-Layer Address option for RFC6939 support
|
|
|
|
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
Signed-off-by: Tom McPhail <tom.mcphail@icloud.com>
|
|
Signed-off-by: Tom McPhail <tom.mcphail@icloud.com>
|
|
Signed-off-by: akshay navale <akshaynawale@gmail.com>
|
|
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
Support for custom logger in servers
|
|
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
server6 object
Signed-off-by: Valerio Santinelli <santinelli@altralogica.it>
|
|
IAPD has PDOptions which allows IAPrefix and StatusCode.
IAPrefix has PrefixOptions which allow StatusCode.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Also removes superfluous GetOne/Del proxy functions.
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
|
|
dhcpv6: add IA_PD to request from advertise
|
|
Add the IA_PD option to the request from the advertise if present.
Add WithIAPD() as modifier and test.
Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
Signed-off-by: Chris Koch <chrisko@google.com>
|
|
dhcp6: fix VendorOpts getter
|
|
|