-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow optional argument to be erased in Dhcp_server.make. (#111)
* Allow optional argument to be erased in Dhcp_server.make. Changes public API, might will break users. * maxleasetime -> max-lease-time like ISC dhcpd.conf. * Fix handling of DHCPRELEASE, DHCPDECLINE probably still broken. RELEASE doesn't have a request ip, the interesting address is in pkt.ciaddr. Can't really test decline, but this improves the current situation at least. * Rewrite server lease database and fix a bunch of bugs. The double reference between old Id_map and Addr_map is too confusing and prone to mistakes, this rewrites so that Addr_map now only gives a Client_id and Lease_map gives a Lease.t. Instead of trying to recycle old leases on the fly and introducing unecessary complications, just remove it all over. Code gets considerably simpler and the caller is responsible for calling Lease.garbage_collect once in a while. Expired leases are kept even if expire, if a client does a discover later on, it might re-active/renew the old lease, this is desirable since he gets to have his same old ip back. Fix a bug where the server *MUST NOT* ack a lease during INIT-REBOOT, it should remain silent, it should ack only when SELECTING or RENEW/REBIDING. With this every ack becomes a lease renew, so we don't need the extra logic of ack ~renew. * Garbage collect in charruad. Once every minute try to prune old leases. This should be configurable in the future. No need for a timer, use packet input as a tick. * Write pid file in charruad. /run is what linux uses theses days, can and probably should be modified via -p. * Implement -u/--user and -g/--group in charruad. Forcing people to run as _charruad is bad. * Shut opam-dune-lint up. * opam: bump lower ocaml bound to 4.08 (module Int in stdlib) * Remove sanity_check from Dhcp_server.replace. Code is good, have some faith brother. Co-authored-by: Hannes Mehnert <hannes@mehnert.org>
- Loading branch information
Showing
10 changed files
with
213 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
opam-version: "2.0" | ||
synopsis: "Unix DHCP daemon" | ||
description: """\ | ||
charrua-unix is an _ISC-licensed_ Unix DHCP daemon based on | ||
[charrua](http://www.github.com/mirage/charrua).""" | ||
maintainer: "Christiano F. Haesbaert <haesbaert@haesbaert.org>" | ||
authors: "Christiano F. Haesbaert <haesbaert@haesbaert.org>" | ||
license: "ISC" | ||
homepage: "https://github.com/mirage/charrua" | ||
bug-reports: "https://github.com/mirage/charrua/issues" | ||
license: "ISC" | ||
dev-repo: "git+https://github.com/mirage/charrua.git" | ||
build: [ | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
depends: [ | ||
"dune" {>= "1.4.0"} | ||
"ocaml" {>= "4.06.0"} | ||
"lwt" {>="3.0.0"} | ||
"ocaml" {>= "4.08.0"} | ||
"lwt" {>= "3.0.0"} | ||
"lwt_log" | ||
"charrua" {= version} | ||
"charrua-server" {= version} | ||
"cstruct-unix" | ||
"cmdliner" | ||
"rawlink" {>= "1.0"} | ||
"tuntap" {>= "2.0.0"} | ||
"mtime" {>="1.0.0"} | ||
"mtime" {>= "1.0.0"} | ||
"cstruct-lwt" {>= "6.0.0"} | ||
"ipaddr" {>= "5.1.0"} | ||
"tcpip" {>= "6.1.0"} | ||
] | ||
synopsis: "Unix DHCP daemon" | ||
description: """ | ||
charrua-unix is an _ISC-licensed_ Unix DHCP daemon based on | ||
[charrua](http://www.github.com/mirage/charrua). | ||
""" | ||
build: [ | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
dev-repo: "git+https://github.com/mirage/charrua.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.