Giter Site home page Giter Site logo

dhcpserver's Introduction

DHCP Server

A stand-alone DHCP server, implemented as an attempt to better grasp the chaos which is the current descendant of the good ol' BOOTP.

Implemented in pure C, no dependencies. Still in beta :)

Usage

You can either launch the binary file directly, specifying all the required options, or use the launch_server.sh script, that also includes the configuration.

Configuration

Portability was one of the objectives I had in mind while writing the code.

Since system and library calls used to retrieve informations (such as MAC addresses, IP addresses and other network-related stuff) differ greatly between *linux, *bsd and other unix-like systems, I decided to "outsource" them into a shell script.

The launch_server.sh contains all the configuration the server requires to run. Give a look at it, and you will understand how to use the program and how to configure it...

License

Copyright 2014 - Emanuele Acri

Offer me a coffee license: use the code as you wish, but offer me a coffee :)

dhcpserver's People

Contributors

crossbowerbt avatar tillz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dhcpserver's Issues

Bugs report

There are two bugs,one is in the args.c:111

     case 'p': // parse pending time
	    {
		time_t *t;

		if(parse_long(optarg, (void **)&t) != 4)
		    usage("error: invalid pending time.", 1);

		pool->pending_time = *t;
		free(t);
		break;
	    }

When you add ASAN during compilation, runtime errors will occur, mainly because free is used to free the memory space allocated for calling calloc, malloc, or realloc, rather than time_ t type(I’m not sure)

ASAN
ASAN_1

gdb debug information
gdb_1

Another bug is in the options.c:387

void
append_option (dhcp_option_list *list, dhcp_option *opt)
{
    dhcp_option *nopt = calloc(1, sizeof(*nopt));
    memcpy(nopt, opt, 2 + opt->len);
    
    TAILQ_INSERT_TAIL(list, nopt, pointers);
}

When opt ->len is not properly initialized or has incorrect values, it can cause stack overflow issues in memcpy

ASAN
ASAN_2

gdb debug information
gdb_2

Would you consider dual licensing?

Hi,

I'm looking for a simple dhcp server that I can adapt into a new BSD licensed embedded system framework (esp-open-rtos). Yours is my preferred candidate, it looks perfect and it shouldn't be too hard to port to a microcontroller IP stack!

However I want to keep esp-open-rtos as BSD licensed. It's unclear to me whether how the "coffee license" works regarding relicensing!

Would you possibly consider dual-licensing your dhcpserver as either coffee license or New BSD, with a non-binding request that BSD licensees please buy you a cofee? That way I can include your project!

I will also gladly buy you a coffee, and if the porting efforts come up with any upstream-friendly changes then I will submit those back as PRs. :)

Of course it's your project so if you want to keep the license the way it is, that's absolutely fine. I just thought I'd ask on the offchance.

Cheers,

Angus

PADDING option not handled

in parse_options_to_list padding option is not handled
see rfc2132 p3.1
3.1. Pad Option
The pad option can be used to cause subsequent fields to align on
word boundaries.
The code for the pad option is 0, and its length is 1 octet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.