Diff between ea8db4892411694e8b8d3648a43b5b69392ada7b and a709b2119b47cca71dca79d11b8705f752ed3295

Changed Files

File Additions Deletions Status
network/server.c +15 -0 modified

Full Patch

diff --git a/network/server.c b/network/server.c
index 7c63c3e..d1da8a9 100644
--- a/network/server.c
+++ b/network/server.c
@@ -394,6 +394,21 @@ static gboolean bnep_setup(GIOChannel *chan,
 		return FALSE;
 	}
 
+	/* Highest known Control command ID
+	 * is BNEP_FILTER_MULT_ADDR_RSP = 0x06 */
+	if (req->type == BNEP_CONTROL &&
+				req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) {
+		uint8_t pkt[3];
+
+		pkt[0] = BNEP_CONTROL;
+		pkt[1] = BNEP_CMD_NOT_UNDERSTOOD;
+		pkt[2] = req->ctrl;
+
+		send(sk, pkt, sizeof(pkt), 0);
+
+		return FALSE;
+	}
+
 	if (req->type != BNEP_CONTROL || req->ctrl != BNEP_SETUP_CONN_REQ)
 		return FALSE;