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 | |
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')
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 9 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 242f7e0..4536040 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; diff --git a/accel-pppd/ctrl/pppoe/pppoe.h b/accel-pppd/ctrl/pppoe/pppoe.h index aac169e..75e0eed 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.h +++ b/accel-pppd/ctrl/pppoe/pppoe.h @@ -70,7 +70,7 @@ struct pppoe_serv_t struct triton_context_t ctx; struct rb_node node; - const struct ap_net *net; + struct ap_net *net; int disc_sock; uint8_t hwaddr[ETH_ALEN]; |