summaryrefslogtreecommitdiff
path: root/ovn/lib
diff options
context:
space:
mode:
authorGregory Smith <gasmith@nutanix.com>2018-12-12 10:46:11 -0800
committerBen Pfaff <blp@ovn.org>2018-12-12 11:51:13 -0800
commitfcc3c93f767f81464cfd9ae59f0d41af1c684d20 (patch)
tree0a5fab8ee5da0bdb5f67768c78b7a380b8f1626b /ovn/lib
parenta550795a976200a24a5d639cd32609d2f3a84350 (diff)
downloadopenvswitch-fcc3c93f767f81464cfd9ae59f0d41af1c684d20.tar.gz
pinctrl: Check requested IP in DHCPREQUEST messages
See RFC 2131, section 4.3.2. When handling a DHCPREQUEST message, the server should validate that the client's requested IP matches the offered IP. If not, the server should reply with a DHCPNAK. The client's requested IP is either specified as the Requested IP Address (option 50), or as the ciaddr, depending on the client's state. Signed-off-by: Gregory Smith <gasmith@nutanix.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn/lib')
-rw-r--r--ovn/lib/ovn-l7.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ovn/lib/ovn-l7.h b/ovn/lib/ovn-l7.h
index 08c3da54a..2412c9e06 100644
--- a/ovn/lib/ovn-l7.h
+++ b/ovn/lib/ovn-l7.h
@@ -138,6 +138,15 @@ dhcp_opts_destroy(struct hmap *dhcp_opts)
gen_opts_destroy(dhcp_opts);
}
+OVS_PACKED(
+struct dhcp_opt_header {
+ uint8_t code;
+ uint8_t len;
+});
+
+#define DHCP_OPT_PAYLOAD(hdr) \
+ (void *)((char *)hdr + sizeof(struct dhcp_opt_header))
+
/* Used in the OpenFlow PACKET_IN userdata */
struct dhcp_opt6_header {
ovs_be16 opt_code;