Fix the DHCP server (fixes #44)
[invirt/packages/python-pydhcplib.git] / debian / patches / non-standard-options.patch
diff --git a/debian/patches/non-standard-options.patch b/debian/patches/non-standard-options.patch
new file mode 100644 (file)
index 0000000..53f3605
--- /dev/null
@@ -0,0 +1,16 @@
+Index: pydhcplib/dhcp_basic_packet.py
+===================================================================
+--- sipb-xen-python-pydhcp/pydhcplib/dhcp_basic_packet.py
++++ sipb-xen-python-pydhcp/pydhcplib/dhcp_basic_packet.py
+@@ -99,9 +99,9 @@
+                              "char":[1,0,1], "16-bits":[2,0,1],
+                              "32-bits":[4,0,1], "identifier":[0,2,1]}
+             
+-            specs = fields_specs[DhcpOptionsTypes[DhcpOptions[name]]]
++            specs = fields_specs.get(DhcpOptionsTypes[DhcpOptions[name]], [])
+             length = len(value)
+-            if (specs[0]!=0 and specs==length) or (specs[1]<=length and length%specs[2]==0):
++            if specs == [] or (specs[0]!=0 and specs==length) or (specs[1]<=length and length%specs[2]==0):
+                 self.options_data[name] = value
+                 return True
+             else :