summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorrabhis <rsabhilashkurup@gmail.com>2017-07-26 23:38:48 +0530
committerrabhis <rsabhilashkurup@gmail.com>2017-07-26 23:38:48 +0530
commitf180a0a7113a7d96924c04d620d2e84ed98e77d4 (patch)
tree39ef082be2a0f20ad7dabe7d317d1be91d75cf31 /accel-pppd/ppp
parent291ddba8d9edc811ad202405055decf4f179981a (diff)
downloadaccel-ppp-f180a0a7113a7d96924c04d620d2e84ed98e77d4.tar.gz
accel-ppp-f180a0a7113a7d96924c04d620d2e84ed98e77d4.zip
fix: connection problem with clients having nomru option
Fixed problem while connecting with clients in which mru not negotiating lcp option is set
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r--accel-pppd/ppp/lcp_opt_mru.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/accel-pppd/ppp/lcp_opt_mru.c b/accel-pppd/ppp/lcp_opt_mru.c
index 486ade7..2f321fb 100644
--- a/accel-pppd/ppp/lcp_opt_mru.c
+++ b/accel-pppd/ppp/lcp_opt_mru.c
@@ -27,6 +27,7 @@ static int mru_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui
static int mru_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
static int mru_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
static int mru_recv_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int mru_recv_conf_rej(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
static void mru_print(void (*print)(const char *fmt, ...), struct lcp_option_t*, uint8_t *ptr);
struct mru_option_t
@@ -35,6 +36,7 @@ struct mru_option_t
int mru;
int mtu;
int naked:1;
+ int rejected:1;
};
static struct lcp_option_handler_t mru_opt_hnd=
@@ -45,6 +47,7 @@ static struct lcp_option_handler_t mru_opt_hnd=
.recv_conf_req = mru_recv_conf_req,
.recv_conf_ack = mru_recv_conf_ack,
.recv_conf_nak = mru_recv_conf_nak,
+ .recv_conf_rej = mru_recv_conf_rej,
.free = mru_free,
.print = mru_print,
};
@@ -81,7 +84,7 @@ static int mru_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui
struct mru_option_t *mru_opt = container_of(opt, typeof(*mru_opt), opt);
struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
- if (mru_opt->naked)
+ if (mru_opt->naked || mru_opt->rejected)
return 0;
opt16->hdr.id = CI_MRU;
@@ -141,6 +144,13 @@ static int mru_recv_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui
mru_opt->naked = 1;
return 0;
}
+static int mru_recv_conf_rej(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt, typeof(*mru_opt), opt);
+
+ mru_opt->rejected = 1;
+ return 0;
+}
static void mru_print(void (*print)(const char *fmt, ...), struct lcp_option_t *opt, uint8_t *ptr)
{