pypxe / PyPXE

Pure Python PXE (DHCP-(Proxy)/TFTP/HTTP/NBD) Server
MIT License
547 stars 125 forks source link

DHCPD's listen() is Overly Global #79

Closed mmattioli closed 9 years ago

mmattioli commented 9 years ago

Proposal

In DHCPD's listen(), the setting of self.options and the check using valid_request is overly global. We should probably use self.leases as we already have client_mac to use as the key. self.options is used in listen(), valid_request, and craft_options.

A simples/self.options/self.leases[client_mac]["options"]/ would actually do the job. Everywhere we access self.options we have client_mac. (Except validate_req, for which we could either pass in client_mac, or option 60).

psychomario commented 9 years ago

I can add this in to #65 when I rebase after the merge to master if that sounds good?

mmattioli commented 9 years ago

@psychomario that's exactly what I was thinking, better to fix two issues in one PR.

psychomario commented 9 years ago

On a technical note, how do I go about rebasing these, accounting for the conflicts that will occur?

mmattioli commented 9 years ago

If you're on the branch associated with that PR (which seems to be branch staticassignments) then a simple git rebase development should do the trick and then replay all your commits on top of it one by one, as each commit is applied if there is a conflict it will stop and tell you there are conflicts and you need to resolve them, once you resolve the conflicts you do a git rebase --continue and it will continue adding commits until another conflict at which point you will need to resolve those conflicts again; this continues until all of your "new" commits (relative to the feature branch) are added/resolved. Then you do a git push. Make sense?

psychomario commented 9 years ago

Got it, thanks. I can get both of my assigned PR's ready now, and I will do the DHCP testing tomorrow.

mmattioli commented 9 years ago

Sounds good :+1: