]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/dhcp/0002-v4_3-Plugs-a-socket-descriptor-leak-in-OMAPI.patch
dhcp: add upstream security fix
[coffee/buildroot.git] / package / dhcp / 0002-v4_3-Plugs-a-socket-descriptor-leak-in-OMAPI.patch
1 From 5097bc0559f592683faac1f67bf350e1bddf6ed4 Mon Sep 17 00:00:00 2001
2 From: Thomas Markwalder <tmark@isc.org>
3 Date: Thu, 7 Dec 2017 11:39:30 -0500
4 Subject: [PATCH] [v4_3] Plugs a socket descriptor leak in OMAPI
5
6         Merges in rt46767.
7
8 [baruch: drop RELNOTES hunk]
9 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
10 ---
11 Patch status: upstream commit 5097bc0559f
12
13  omapip/buffer.c  | 9 +++++++++
14  omapip/message.c | 2 +-
15
16 diff --git a/omapip/buffer.c b/omapip/buffer.c
17 index f7fdc3250e82..809034d1317b 100644
18 --- a/omapip/buffer.c
19 +++ b/omapip/buffer.c
20 @@ -566,6 +566,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
21                         omapi_buffer_dereference (&buffer, MDL);
22                 }
23         }
24 +
25 +       /* If we had data left to write when we're told to disconnect,
26 +       * we need recall disconnect, now that we're done writing.
27 +       * See rt46767. */
28 +       if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) {
29 +               omapi_disconnect (h, 1);
30 +               return ISC_R_SHUTTINGDOWN;
31 +       }
32 +
33         return ISC_R_SUCCESS;
34  }
35  
36 diff --git a/omapip/message.c b/omapip/message.c
37 index 59ccdc2c05cf..21bcfc3822e7 100644
38 --- a/omapip/message.c
39 +++ b/omapip/message.c
40 @@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
41  }
42  
43  #ifdef DEBUG_PROTOCOL
44 -static const char *omapi_message_op_name(int op) {
45 +const char *omapi_message_op_name(int op) {
46         switch (op) {
47         case OMAPI_OP_OPEN:    return "OMAPI_OP_OPEN";
48         case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH";
49 -- 
50 2.15.1
51