提交 fbaeb8c4 编写于 作者: R rabhis 提交者: Dmitry Kozlov

fix: connection problem with clients having nomru option

Fixed problem while connecting with clients in which mru not
negotiating lcp option is set
上级 02b08916
...@@ -27,6 +27,7 @@ static int mru_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui ...@@ -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_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_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_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); static void mru_print(void (*print)(const char *fmt, ...), struct lcp_option_t*, uint8_t *ptr);
struct mru_option_t struct mru_option_t
...@@ -35,6 +36,7 @@ struct mru_option_t ...@@ -35,6 +36,7 @@ struct mru_option_t
int mru; int mru;
int mtu; int mtu;
int naked:1; int naked:1;
int rejected:1;
}; };
static struct lcp_option_handler_t mru_opt_hnd= static struct lcp_option_handler_t mru_opt_hnd=
...@@ -45,6 +47,7 @@ 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_req = mru_recv_conf_req,
.recv_conf_ack = mru_recv_conf_ack, .recv_conf_ack = mru_recv_conf_ack,
.recv_conf_nak = mru_recv_conf_nak, .recv_conf_nak = mru_recv_conf_nak,
.recv_conf_rej = mru_recv_conf_rej,
.free = mru_free, .free = mru_free,
.print = mru_print, .print = mru_print,
}; };
...@@ -81,7 +84,7 @@ static int mru_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui ...@@ -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 mru_option_t *mru_opt = container_of(opt, typeof(*mru_opt), opt);
struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr; struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
if (mru_opt->naked) if (mru_opt->naked || mru_opt->rejected)
return 0; return 0;
opt16->hdr.id = CI_MRU; 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 ...@@ -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; mru_opt->naked = 1;
return 0; 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) static void mru_print(void (*print)(const char *fmt, ...), struct lcp_option_t *opt, uint8_t *ptr)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册