diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2013-10-02 22:23:33 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-10-02 22:23:33 +0400 |
commit | 6b442343da91747481c07f12584866ef34ed8917 (patch) | |
tree | c60bc79b63eea94c16eea068750ec95420d04e1b /accel-pppd | |
parent | 51e8afbe3c7b32b63ce5db466ed75ef59d2b92fc (diff) | |
download | accel-ppp-6b442343da91747481c07f12584866ef34ed8917.tar.gz accel-ppp-6b442343da91747481c07f12584866ef34ed8917.zip |
ipoe: make it possible to use 'username=ifname' for UP sessions
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9792152..ac1a68f 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -40,8 +40,9 @@ #include "memdebug.h" -#define USERNAME_IFNAME 0 -#define USERNAME_LUA 1 +#define USERNAME_UNSET 0 +#define USERNAME_IFNAME 1 +#define USERNAME_LUA 2 #define MODE_L2 0 #define MODE_L3 1 @@ -1526,8 +1527,9 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc u_inet_ntoa(iph->saddr, ses->ctrl.calling_station_id); u_inet_ntoa(iph->daddr, ses->ctrl.called_station_id); - - ses->ses.username = _strdup(ses->ctrl.calling_station_id); + + if (conf_username == USERNAME_UNSET) + ses->ses.username = _strdup(ses->ctrl.calling_station_id); ses->ses.ctrl = &ses->ctrl; ses->ses.chan_name = ses->ctrl.calling_station_id; @@ -2686,7 +2688,8 @@ static void load_config(void) #endif else log_emerg("ipoe: unknown username value '%s'\n", opt); - } + } else + conf_username = USERNAME_UNSET; opt = conf_get_opt("ipoe", "netmask"); if (opt) { |