]> git.proxmox.com Git - mirror_ovs.git/commitdiff
OVN: Add support for DHCP option 210 - path prefix
authorLucas Alvares Gomes <lucasagomes@gmail.com>
Thu, 7 Mar 2019 16:28:34 +0000 (16:28 +0000)
committerBen Pfaff <blp@ovn.org>
Thu, 7 Mar 2019 22:11:50 +0000 (14:11 -0800)
OpenStack Ironic relies on few DHCP options [0] that are not yet supported
in OVN, one of them is the 210 (PATH PREFIX, RFC5071 [1]).

[0]
https://github.com/openstack/ironic/blob/3f6d4c6a789b12512d6cc67cdbc93ba5fbf29848/ironic/common/pxe_utils.py#L44-L54
[1] https://tools.ietf.org/html/rfc5071#section-5

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovn/lib/ovn-l7.h
ovn/northd/ovn-northd.c
ovn/ovn-nb.xml
tests/ovn.at
tests/test-ovn.c

index 76b26e70f634d7be9aebf686ebe9c895701a7fbb..a2224d0193c8ab0f38da57475e175fb29432a9b8 100644 (file)
@@ -72,6 +72,7 @@ struct gen_opts_map {
 
 #define DHCP_OPT_BOOTFILE DHCP_OPTION("bootfile_name", 67, "str")
 #define DHCP_OPT_WPAD DHCP_OPTION("wpad", 252, "str")
+#define DHCP_OPT_PATH_PREFIX DHCP_OPTION("path_prefix", 210, "str")
 
 static inline uint32_t
 gen_opt_hash(char *opt_name)
index d554d679488d2b56e490177ff288b9e951ec76ea..1a59c9fa9cb4cee494b483c16e46092a31e13a26 100644 (file)
@@ -7388,6 +7388,7 @@ static struct gen_opts_map supported_dhcp_opts[] = {
     DHCP_OPT_T2,
     DHCP_OPT_WPAD,
     DHCP_OPT_BOOTFILE,
+    DHCP_OPT_PATH_PREFIX,
 };
 
 static struct gen_opts_map supported_dhcpv6_opts[] = {
index 18396507dba5f3c9ab39754ce35000b8f51701ac..b084c821e8705d62cb8ae8e790597683054d3595 100644 (file)
             to identify a bootfile.
           </p>
         </column>
+
+        <column name="options" key="path_prefix">
+          <p>
+            The DHCPv4 option code for this option is 210. In PXELINUX'
+            case this option is used to set a common path prefix,
+            instead of deriving it from the bootfile name.
+          </p>
+        </column>
       </group>
     </group>
 
index 2af225a678e19d5650e0c5dd3936a09c77abe5a1..a5a6c66524653dfa40701ecfa94aaf47f00b4d63 100644 (file)
@@ -1104,9 +1104,9 @@ put_arp(inport, arp.spa, arp.sha);
 # put_dhcp_opts
 reg1[0] = put_dhcp_opts(offerip = 1.2.3.4, router = 10.0.0.1);
     encodes as controller(userdata=00.00.00.02.00.00.00.00.00.01.de.10.00.00.00.40.01.02.03.04.03.04.0a.00.00.01,pause)
-reg2[5] = put_dhcp_opts(offerip=10.0.0.4,router=10.0.0.1,netmask=255.255.254.0,mtu=1400,domain="ovn.org",wpad="https://example.org",bootfile_name="https://127.0.0.1/boot.ipxe");
-    formats as reg2[5] = put_dhcp_opts(offerip = 10.0.0.4, router = 10.0.0.1, netmask = 255.255.254.0, mtu = 1400, domain = "ovn.org", wpad = "https://example.org", bootfile_name = "https://127.0.0.1/boot.ipxe");
-    encodes as controller(userdata=00.00.00.02.00.00.00.00.00.01.de.10.00.00.00.25.0a.00.00.04.03.04.0a.00.00.01.01.04.ff.ff.fe.00.1a.02.05.78.0f.07.6f.76.6e.2e.6f.72.67.fc.13.68.74.74.70.73.3a.2f.2f.65.78.61.6d.70.6c.65.2e.6f.72.67.43.1b.68.74.74.70.73.3a.2f.2f.31.32.37.2e.30.2e.30.2e.31.2f.62.6f.6f.74.2e.69.70.78.65,pause)
+reg2[5] = put_dhcp_opts(offerip=10.0.0.4,router=10.0.0.1,netmask=255.255.254.0,mtu=1400,domain="ovn.org",wpad="https://example.org",bootfile_name="https://127.0.0.1/boot.ipxe",path_prefix="/tftpboot");
+    formats as reg2[5] = put_dhcp_opts(offerip = 10.0.0.4, router = 10.0.0.1, netmask = 255.255.254.0, mtu = 1400, domain = "ovn.org", wpad = "https://example.org", bootfile_name = "https://127.0.0.1/boot.ipxe", path_prefix = "/tftpboot");
+    encodes as controller(userdata=00.00.00.02.00.00.00.00.00.01.de.10.00.00.00.25.0a.00.00.04.03.04.0a.00.00.01.01.04.ff.ff.fe.00.1a.02.05.78.0f.07.6f.76.6e.2e.6f.72.67.fc.13.68.74.74.70.73.3a.2f.2f.65.78.61.6d.70.6c.65.2e.6f.72.67.43.1b.68.74.74.70.73.3a.2f.2f.31.32.37.2e.30.2e.30.2e.31.2f.62.6f.6f.74.2e.69.70.78.65.d2.09.2f.74.66.74.70.62.6f.6f.74,pause)
 reg0[15] = put_dhcp_opts(offerip=10.0.0.4,router=10.0.0.1,netmask=255.255.255.0,mtu=1400,ip_forward_enable=1,default_ttl=121,dns_server={8.8.8.8,7.7.7.7},classless_static_route={30.0.0.0/24,10.0.0.4,40.0.0.0/16,10.0.0.6,0.0.0.0/0,10.0.0.1},ethernet_encap=1,router_discovery=0);
     formats as reg0[15] = put_dhcp_opts(offerip = 10.0.0.4, router = 10.0.0.1, netmask = 255.255.255.0, mtu = 1400, ip_forward_enable = 1, default_ttl = 121, dns_server = {8.8.8.8, 7.7.7.7}, classless_static_route = {30.0.0.0/24, 10.0.0.4, 40.0.0.0/16, 10.0.0.6, 0.0.0.0/0, 10.0.0.1}, ethernet_encap = 1, router_discovery = 0);
     encodes as controller(userdata=00.00.00.02.00.00.00.00.00.01.de.10.00.00.00.6f.0a.00.00.04.03.04.0a.00.00.01.01.04.ff.ff.ff.00.1a.02.05.78.13.01.01.17.01.79.06.08.08.08.08.08.07.07.07.07.79.14.18.1e.00.00.0a.00.00.04.10.28.00.0a.00.00.06.00.0a.00.00.01.24.01.01.1f.01.00,pause)
index bafe7bbc8ff190f8e8af767f5055e458122add90..8e8c38a660cc12a6423007322774184a99e4c1a4 100644 (file)
@@ -184,6 +184,7 @@ create_gen_opts(struct hmap *dhcp_opts, struct hmap *dhcpv6_opts,
     dhcp_opt_add(dhcp_opts, "lease_time",  51, "uint32");
     dhcp_opt_add(dhcp_opts, "wpad", 252, "str");
     dhcp_opt_add(dhcp_opts, "bootfile_name", 67, "str");
+    dhcp_opt_add(dhcp_opts, "path_prefix", 210, "str");
 
     /* DHCPv6 options. */
     hmap_init(dhcpv6_opts);