niccokunzmann / python_dhcp_server

a dhcp server in python
MIT License
89 stars 32 forks source link

Prevent duplicate assignment of IP addresses. #19

Closed mjmdavis closed 1 year ago

mjmdavis commented 1 year ago

Add a check to prevent two devices being assigned the same IP address when a device requests an IP address that is taken by another device on the network.

Do not iterate options if they are None. I had an issue with one device where the options were none and it caused an exception and the DHCP address assignment to fail.

Made the window a bit wider to accomodate wider hostnames. We had some confusion when random letters were appearing on new lines but it turned out to be a longer hostname causing the text to wrap.

mjmdavis commented 1 year ago

@niccokunzmann Thanks for taking a look at this. I've addressed the comments you made. Let me know what you think.

niccokunzmann commented 1 year ago

Uh. Options can be None? They should be {} instead. None makes no sense. My guess is that this would be a mistake on my side.

mjmdavis commented 1 year ago

Looking at your code, I also suspected that options would always be iterable. I did get the exception though.

I can have another look later this week. I don't have easy access to the device where it happened.

niccokunzmann commented 1 year ago

Ok. As you confirm that this exception can happen, then I will trust you. I just wanted to make sure that it is not an accidental change and you know what you are doing.

niccokunzmann commented 1 year ago

Thanks for your contribution! I would offer to you: Would you like to become a backup-maintainer? Like if I do not respond for two weeks, you can merge your own pull requests and you can merge other people's if you like?

mjmdavis commented 1 year ago

@niccokunzmann Wäre sehr nett. Danke.

niccokunzmann commented 1 year ago

Done! If you like, you can also follow the release procedure to create a new release. If you do not do it, I might do it after a while. #20