diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-07-11 09:47:04 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-07-11 09:47:04 +0300 |
commit | e0cca4344f70b9c9e23e3c6a7e17c8e93c765184 (patch) | |
tree | 1068654b025b2e24c983d99776696ad889a0c138 /accel-pppd/ctrl/pppoe/pppoe.c | |
parent | 6fb04941ca41312909208938bfac4f753d3c277c (diff) | |
download | accel-ppp-e0cca4344f70b9c9e23e3c6a7e17c8e93c765184.tar.gz accel-ppp-e0cca4344f70b9c9e23e3c6a7e17c8e93c765184.zip |
implemented support for network namespace
This is done using radius attribute NAS-Port-Id. The new format of this attribute is NAS-Port-Id=[ns/][name].
Namespaces must be created malually by "ip netns add ..." command
Diffstat (limited to 'accel-pppd/ctrl/pppoe/pppoe.c')
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 242f7e07..4536040d 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -264,7 +264,7 @@ static int pppoe_rad_send_accounting_request(struct rad_plugin_t *rad, struct ra static void pppoe_conn_ctx_switch(struct triton_context_t *ctx, void *arg) { struct pppoe_conn_t *conn = arg; - net = conn->serv->net; + net = conn->ppp.ses.net; log_switch(ctx, &conn->ppp.ses); } @@ -400,6 +400,7 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui ppp_init(&conn->ppp); + conn->ppp.ses.net = serv->net; conn->ppp.ses.ctrl = &conn->ctrl; conn->ppp.ses.chan_name = conn->ctrl.calling_station_id; @@ -1266,7 +1267,7 @@ static void pppoe_serv_timeout(struct triton_timer_t *t) pppoe_server_free(serv); } -static int parse_server(const char *opt, int *padi_limit, const struct ap_net **net) +static int parse_server(const char *opt, int *padi_limit, struct ap_net **net) { char *ptr, *endptr; char name[64]; @@ -1374,7 +1375,7 @@ static void __pppoe_server_start(const char *ifname, const char *opt, void *cli, struct pppoe_serv_t *serv; struct ifreq ifr; int padi_limit = conf_padi_limit; - const struct ap_net *net = &def_net; + struct ap_net *net = def_net; if (parse_server(opt, &padi_limit, &net)) { if (cli) @@ -1462,7 +1463,7 @@ static void __pppoe_server_start(const char *ifname, const char *opt, void *cli, goto out_err; } - if (parent_ifindex == -1 && net == &def_net) + if (parent_ifindex == -1 && net == def_net) vid = iplink_vlan_get_vid(ifr.ifr_ifindex, &parent_ifindex); serv->ctx.close = pppoe_serv_close; |