diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2018-02-20 18:50:25 +0100 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-02-21 22:25:20 +0300 |
commit | 8ab2f623fa1d11a2aaec35226cb7a1456fc257d8 (patch) | |
tree | 093d82941fa97d7726bd5e1870c69b1e346aa8a1 /accel-pppd/ctrl | |
parent | c99e2092e9ad048e61110fd094d72e3d55cb49bc (diff) | |
download | accel-ppp-8ab2f623fa1d11a2aaec35226cb7a1456fc257d8.tar.gz accel-ppp-8ab2f623fa1d11a2aaec35226cb7a1456fc257d8.zip |
radius: add support for route priority (metric) in Framed-Route
Let an optional route priority (aka metric) be defined in RADIUS
Framed-Route attributes.
The priority is an integer placed at the end of the route string. This
is backward compatible with the previous format and also conforms with
the recommended format defined by RFC 2865 (although we don't allow
multiple metrics).
Framed-Route format is:
<network> [<gateway> [<priority>]]
For example, 'Framed-Route = "192.0.2.0/24 203.0.113.1 8"' will let
the following route be installed (assuming 203.0.113.1 is routed
through eth0):
$ ip route show
[...]
192.0.2.0/24 via 203.0.113.1 dev eth0 metric 8
It's possible to use the unspecified gateway (0.0.0.0) if one wants to
set a priority without specifying a gateway address.
Finally, route deletion now also takes the priority into account, in
order to avoid removing a different route accidentally.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 35f97d83..5fd64e2a 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -977,9 +977,9 @@ static void __ipoe_session_activate(struct ipoe_session *ses) if (ses->ifindex == -1) { if (!conf_ip_unnumbered) - iproute_add(serv->ifindex, ses->router, ses->yiaddr, 0, conf_proto, ses->mask); + iproute_add(serv->ifindex, ses->router, ses->yiaddr, 0, conf_proto, ses->mask, 0); else if (!serv->opt_ifcfg) - iproute_add(serv->ifindex, serv->opt_src ?: ses->router, ses->yiaddr, 0, conf_proto, 32); + iproute_add(serv->ifindex, serv->opt_src ?: ses->router, ses->yiaddr, 0, conf_proto, 32, 0); } if (ses->l4_redirect) @@ -1078,7 +1078,7 @@ static void ipoe_session_started(struct ap_session *s) if (ses->ses.ipv4->peer_addr != ses->yiaddr) //ipaddr_add_peer(ses->ses.ifindex, ses->router, ses->yiaddr); // breaks quagga - iproute_add(ses->ses.ifindex, ses->router, ses->yiaddr, 0, conf_proto, 32); + iproute_add(ses->ses.ifindex, ses->router, ses->yiaddr, 0, conf_proto, 32, 0); if (ses->ifindex != -1 && ses->xid) { ses->dhcpv4 = dhcpv4_create(ses->ctrl.ctx, ses->ses.ifname, ""); @@ -1163,9 +1163,9 @@ static void ipoe_session_finished(struct ap_session *s) if (serv->opt_ifcfg) ipaddr_del(serv->ifindex, ses->router, conf_ip_unnumbered ? 32 : ses->mask); else if (conf_ip_unnumbered) - iproute_del(serv->ifindex, ses->yiaddr, conf_proto, 32); + iproute_del(serv->ifindex, ses->yiaddr, conf_proto, 32, 0); else - iproute_del(serv->ifindex, ses->yiaddr, conf_proto, ses->mask); + iproute_del(serv->ifindex, ses->yiaddr, conf_proto, ses->mask, 0); } if (ses->dhcp_addr) |