]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- For #762: relocate edns_opt_list_append_keepalive.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Thu, 22 Jun 2023 10:11:28 +0000 (12:11 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Thu, 22 Jun 2023 10:11:28 +0000 (12:11 +0200)
util/data/msgparse.c
util/data/msgreply.c
util/data/msgreply.h

index 9f3afd5edd43b7ac480e07628b05c64e32cb3e54..221ff5dfda01330bfc776c1f57ee2645d2a9ba6f 100644 (file)
@@ -941,17 +941,6 @@ parse_packet(sldns_buffer* pkt, struct msg_parse* msg, struct regional* region)
        return 0;
 }
 
-static int
-edns_opt_list_append_keepalive(struct edns_option** list, int msec,
-               struct regional* region)
-{
-       uint8_t data[2]; /* For keepalive value */
-       data[0] = (uint8_t)((msec >> 8) & 0xff);
-       data[1] = (uint8_t)(msec & 0xff);
-       return edns_opt_list_append(list, LDNS_EDNS_KEEPALIVE, sizeof(data),
-                       data, region);
-}
-
 /** RFC 1982 comparison, uses unsigned integers, and tries to avoid
  * compiler optimization (eg. by avoiding a-b<0 comparisons),
  * this routine matches compare_serial(), for SOA serial number checks */
index 1e6ee97040cf3b16d1046338e5ccb1d4d7ccfe0f..d02fcb4a8c6b28b3515063ca483d8537a9af0a6b 100644 (file)
@@ -1020,6 +1020,16 @@ int edns_opt_list_append_ede(struct edns_option** list, struct regional* region,
        return 1;
 }
 
+int edns_opt_list_append_keepalive(struct edns_option** list, int msec,
+       struct regional* region)
+{
+       uint8_t data[2]; /* For keepalive value */
+       data[0] = (uint8_t)((msec >> 8) & 0xff);
+       data[1] = (uint8_t)(msec & 0xff);
+       return edns_opt_list_append(list, LDNS_EDNS_KEEPALIVE, sizeof(data),
+               data, region);
+}
+
 int edns_opt_list_append(struct edns_option** list, uint16_t code, size_t len,
        uint8_t* data, struct regional* region)
 {
index 9538adc5a8b2bf7d48b02c72b2c53af14bfa9777..3b6009f471e617c5503a8f476df3d4c79b61e981 100644 (file)
@@ -567,6 +567,16 @@ int edns_opt_list_append(struct edns_option** list, uint16_t code, size_t len,
 int edns_opt_list_append_ede(struct edns_option** list, struct regional* region,
        sldns_ede_code code, const char *txt);
 
+/**
+ * Append edns keep alive option to edns options list
+ * @param list: the edns option list to append the edns option to.
+ * @param msec: the duration in msecs for the keep alive.
+ * @param region: region to allocate the new edns option.
+ * @return false on failure.
+ */
+int edns_opt_list_append_keepalive(struct edns_option** list, int msec,
+       struct regional* region);
+
 /**
  * Remove any option found on the edns option list that matches the code.
  * @param list: the list of edns options.