ppp->encap = encap;
switch (encap) {
case PPP_ENCAP_F5:
+ /* XX: F5 server cancels our IP address allocation if we PPP-terminate */
+ ppp->no_terminate_on_pause = 1;
ppp->encap_len = 4;
break;
case PPP_ENCAP_F5_HDLC:
+ /* XX: F5 server cancels our IP address allocation if we PPP-terminate */
+ ppp->no_terminate_on_pause = 1;
+ /* fall through */
+
case PPP_ENCAP_RFC1662_HDLC:
ppp->encap_len = 0;
ppp->hdlc = 1;
break;
case PPPS_NETWORK:
- if (vpninfo->got_pause_cmd || vpninfo->got_cancel_cmd)
+ /* XX: When we pause and reconnect, we expect the auth cookie/session (external to the
+ * PPP layer) to remain valid, and to negotiate the same IP addresses on reconnection.
+ *
+ * However, some servers cancel our session or cancel our IP address allocation if we
+ * TERMINATE at the PPP layer, so we shouldn't do it when pausing.
+ */
+ if (vpninfo->got_cancel_cmd ||
+ (vpninfo->got_pause_cmd && !ppp->no_terminate_on_pause))
ppp->ppp_state = PPPS_TERMINATE;
else
break;