Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
Part two of this:

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 391, in wrappedHandler
    f(self, wrapper)
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 498, in _handleDHCPDiscover
    if wrapper.loadDHCPPacket(definition):
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 346, in loadDHCPPacket
    self._original_packet
  File "/root/staticdhcpd-read-only-2/staticDHCPd/conf/conf.py", line 224, in loadDHCPPacket
    print source_packet
  File "/root/staticdhcpd-read-only-2/staticDHCPd/libpydhcpserver/dhcp_types/packet.py", line 1030, in __str__
    result = _FORMAT_CONVERSION_DESERIAL[DHCP_OPTIONS_TYPES[option_id]](data)
KeyError: 'RFC3004_77'

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 391, in wrappedHandler
    f(self, wrapper)
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 498, in _handleDHCPDiscover
    if wrapper.loadDHCPPacket(definition):
  File "/root/staticdhcpd-read-only-2/staticDHCPd/staticdhcpdlib/dhcp.py", line 346, in loadDHCPPacket
    self._original_packet
  File "/root/staticdhcpd-read-only-2/staticDHCPd/conf/conf.py", line 224, in loadDHCPPacket
    print source_packet
  File "/root/staticdhcpd-read-only-2/staticDHCPd/libpydhcpserver/dhcp_types/packet.py", line 1030, in __str__
    result = _FORMAT_CONVERSION_DESERIAL[DHCP_OPTIONS_TYPES[option_id]](data)
KeyError: 'Unassigned'


I fixed all of these with the following patch:

Index: libpydhcpserver/dhcp_types/constants.py
===================================================================
--- libpydhcpserver/dhcp_types/constants.py     (revision 776)
+++ libpydhcpserver/dhcp_types/constants.py     (working copy)
@@ -218,7 +218,7 @@
  74: TYPE_IPV4_PLUS,
  75: TYPE_IPV4_PLUS,
  76: TYPE_IPV4_PLUS,
- 77: "RFC3004_77", #Not implemented; not necessary for static model
+ 77: TYPE_NONE, #Not implemented; not necessary for static model
  78: "RFC2610_78", #Implemented
  79: "RFC2610_79", #Implemented
  80: TYPE_NONE,
@@ -284,7 +284,7 @@
  163: "Unassigned", 164: "Unassigned", 165: "Unassigned", 166: "Unassigned",
  167: "Unassigned", 168: "Unassigned", 169: "Unassigned", 170: "Unassigned",
  171: "Unassigned", 172: "Unassigned", 173: "Unassigned", 174: "Unassigned",
- 175: "Unassigned", #Etherboot
+ 175: TYPE_NONE, #Etherboot
  176: "Unassigned", #IP Telephone
  177: "Unassigned", #Etherboot
  178: "Unassigned", 179: "Unassigned", 180: "Unassigned", 181: "Unassigned",
@@ -459,6 +459,7 @@
  'capwap_ac_v4': 138,
  'ipv4_mos': 139,
  'fqdn_mos': 140,
+ 'ipxe_test': 175,
  #hole
  'pxelinux_magic': 208,
  'configuration_file': 209,


Original comment by [email protected] on 3 Oct 2014 at 7:15

from staticdhcpd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
In r782, this is handled by making the string-serialiser less-naive when 
iterating over options. Providing a null implementation for something that is 
unsupported seems like a bad idea (because it doesn't explicitly mark it as 
untouched for anyone looking to extend functionality), but the net effect would 
be about the same.

Since you've got an iPXE setup, any practical data you can share could help 
with building a useful implementation for the protocol. (I'll be leaving this 
issue unclosed in case you want to follow up on it)

As always, thanks for the feedback!

Original comment by red.hamsterx on 9 Oct 2014 at 1:11

from staticdhcpd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024

Original comment by red.hamsterx on 9 Oct 2014 at 1:11

  • Changed state: Started

from staticdhcpd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
iPXE uses this field to indicate some additional data about it's configuration 
(such as what protocols are supported).  This is documented at 
http://ipxe.org/howto/dhcpd#ipxe-specific_options

This does have some handy uses (for example, you can burn a trimmed down 
version of iPXE to your NIC's flash, and then load a fully featured version 
over the network).

However, it's a fairly uncommon feature (most people use the NIC's built in 
firmware to load iPXE, so feature checks are unnecessary)

Original comment by [email protected] on 9 Oct 2014 at 1:32

from staticdhcpd.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
Somehow skipped over this one following your last reply. Sorry. :(

Merged in r785. I went with TYPE_STRING instead of TYPE_NONE, since that allows 
for the possibility of the operator entering their own data and parsing 
requests. If you can provide a raw packet capture at some point in the future, 
I'll reimplement it as a proper data-structure.

Original comment by red.hamsterx on 21 Mar 2015 at 4:12

from staticdhcpd.

Related Issues (20)

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.