summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/accel-ppp.conf.52
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c15
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index bfc5427f..c8c8ce12 100644
--- a/accel-pppd/accel-ppp.conf.5
+++ b/accel-pppd/accel-ppp.conf.5
@@ -302,6 +302,8 @@ parameter.
.BI "" [,src=x.x.x.x]
.BI "" [,proxy-arp=0|1|2]
.BI "" [,username=ifname|lua:function]
+.BI "" [,ipv6=0|1]
+.BI "" [,mtu=N]
.br
Specifies interface to listen dhcp or unclassified packets. You may specify multiple
.B interface
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 8687d1f4..80d06a62 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -563,6 +563,9 @@ static int ipoe_create_interface(struct ipoe_session *ses)
ses->ses.ifindex = ses->ifindex;
ses->ses.unit_idx = ses->ifindex;
+ if (ses->serv->opt_mtu)
+ iplink_set_mtu(ses->ses.ifindex, ses->serv->opt_mtu);
+
log_ppp_info2("create interface %s parent %s\n", ifr.ifr_name, ses->serv->ifname);
return 0;
@@ -2659,6 +2662,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
int opt_username = conf_username;
int opt_ipv6 = conf_ipv6;
int opt_auto = conf_auto;
+ int opt_mtu = 0;
#ifdef USE_LUA
char *opt_lua_username_func = NULL;
#endif
@@ -2726,6 +2730,8 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
opt_arp = atoi(ptr1);
} else if (strcmp(str, "ipv6") == 0) {
opt_ipv6 = atoi(ptr1);
+ } else if (strcmp(str, "mtu") == 0) {
+ opt_mtu = atoi(ptr1);
} else if (strcmp(str, "username") == 0) {
if (strcmp(ptr1, "ifname") == 0)
opt_username = USERNAME_IFNAME;
@@ -2817,6 +2823,11 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
} else if (!serv->arp && opt_arp)
serv->arp = arpd_start(serv);
+ if (serv->opt_mtu != opt_mtu && opt_mtu) {
+ iplink_set_mtu(serv->ifindex, opt_mtu);
+ serv->opt_mtu = opt_mtu;
+ }
+
serv->opt_up = opt_up;
serv->opt_auto = opt_auto;
serv->opt_mode = opt_mode;
@@ -2910,6 +2921,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
serv->opt_arp = opt_arp;
serv->opt_username = opt_username;
serv->opt_ipv6 = opt_ipv6;
+ serv->opt_mtu = opt_mtu;
#ifdef USE_LUA
serv->opt_lua_username_func = opt_lua_username_func;
#endif
@@ -2943,6 +2955,9 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
set_vlan_timeout(serv);
}
+ if (opt_mtu)
+ iplink_set_mtu(ifindex, opt_mtu);
+
if (serv->opt_auto && !serv->opt_shared)
triton_context_call(&serv->ctx, (triton_event_func)ipoe_session_create_auto, serv);
diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h
index f8bc82bf..2b04ea06 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.h
+++ b/accel-pppd/ctrl/ipoe/ipoe.h
@@ -53,6 +53,7 @@ struct ipoe_serv {
uint32_t opt_src;
int opt_arp;
int opt_username;
+ int opt_mtu;
#ifdef USE_LUA
char *opt_lua_username_func;
#endif