]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
ppp: Reject unknown protocols
authorAndreas Gnau <rondom@rondom.de>
Sun, 17 May 2020 17:46:09 +0000 (19:46 +0200)
committerAndreas Gnau <rondom@rondom.de>
Sun, 17 May 2020 20:32:02 +0000 (22:32 +0200)
NX won't send any IPCP requests until CCP negotiation is completed.
Since we don't want to implement compression for now (or ever), reject
unknown protocols with an LCP Protocol-Reject (cf. RFC 1661, ch. 5.7).

Signed-off-by: Andreas Gnau <rondom@rondom.de>
ppp.c

diff --git a/ppp.c b/ppp.c
index 5186b1c1de80a846d721dc12e93a0c3bccc78185..1a2a6b4ff9ee2b0b69b56a17aa3bf1d68d29782d 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -1087,7 +1087,9 @@ int ppp_mainloop(struct openconnect_info *vpninfo, int *timeout, int readable)
                                     _("PPP packet with unknown protocol 0x%04x. Payload:\n"),
                                     proto);
                        dump_buf_hex(vpninfo, PRG_ERR, '<', pp, payload_len);
-                       return 1;
+                       if (queue_config_packet(vpninfo, PPP_LCP, ++ppp->lcp.id, PROTREJ, payload_len + (pp - ph), ph))
+                               vpn_progress(vpninfo, PRG_ERR,
+                                            _("Failed queuing Protocol-Reject for unknown protocol 0x%04x.\n"), proto);
                }
 
                if (next_len) {