summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/server6
AgeCommit message (Collapse)Author
2019-10-01server{4,6}: Return UDPConn from NewIPv*UDPConnAnatole Denis
The concrete type under the interface is known here since we create the connection in the same function. Since *net.UDPConn implements net.PacketConn anyway, returning the concrete type here is more powerful and less risky than having downstream users cast the value themselves There should be no code change for downstream users, with the exception of explicit casts (`udpc := conn.(*net.UDPConn)`), which can simply be removed Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2019-09-25server6: allow nil IP in addition to unspecifiedChris K
Signed-off-by: Chris Koch <chrisko@google.com>
2019-09-18server6: Create UDP conn manually for more controlAnatole Denis
Similar to server4 where the UDP connection is manually created using the socket interfaces, this creates a connection with adequate options: * SO_BINDTODEVICE or equivalent if an interface is requested * V6ONLY when supported by the operating system * Allows binding to a multicast address specifically instead of falling back to wildcard Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2019-09-17server6: Fix listening on multicast addressesAnatole Denis
Joining a multicast group with an address that can't be received on a socket is ineffective, at least on linux. This updates the logic of NewServer in a mostly backwards-compatible way, to enable listening on arbitrary multicast addresses: * Unicast addresses see no user-visible change, but don't join a multicast group for which they don't receive traffic anyway * Multicast addresses start actually receiving traffic for the group they represent, and don't join the default group. **this is a behaviour change**: previously they would receive traffic for the default group if it was on the same port and **not** for the group they represent. I consider that previous behaviour a bug * Wildcard addresses, if on the proper port, will join both AllDHCPRelayAgentsAndServers and AllDHCPServers **this is a behaviour change**: previously only AllDHCPRelayAgentsAndServers was joined * Wildcard addresses on another port: no visible change, same as unicast case Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2019-05-08Addressed more linter warningsAndrea Barberio
Mostly addressed missing error checking. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-29[server6] Server should join multicast addressAndrea Barberio
The previous logic was wrong - there's no "listening" on multicast address, the server should listen on the given address, and join the multicast group. This PR fixes it. Also moved the multicast addresses to a common package. Tested with unit/integ tests, and with coredhcp. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-17[server] Serve returns an error, and closes when doneAndrea Barberio
Server6 and Server4 had Serve methods that return without reporting an error, changed in this PR. Serve now also closes the connection when done. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-07nclient6: small fixesChristopher Koch
- RapidCommit solicits wait for Reply messages, not Advertise. - Default recipient should be all relay agents and servers, not just servers. - Make New() and NewWithConn() interface same as in nclient4. Signed-off-by: Christopher Koch <chrisko@google.com>
2019-04-04client6: new async DHCPv6 client like #250.Christopher Koch
- Race-condition-averse. - Supports multiple concurrent requests. - Tested. - Requires a fully compatible net.PacketConn. Signed-off-by: Christopher Koch <chrisko@google.com>
2019-03-11dhcpv6: remove setters and getters.Christopher Koch
- Make members directly accessible.
2019-01-28Created examples directory and adjusted READMEAndrea Barberio
2019-01-28dhcpv6: moved client into dhcpv6/client6Andrea Barberio