diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-11-26 17:43:35 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-11-26 17:43:35 +0300 |
commit | 97ea33f5e749196d216f49f4dbfe7cbc89fe02b7 (patch) | |
tree | ecc45c17957a59b35ef000069091618cfde24972 | |
parent | 0227b8ba98624c54665223e9d82921f17bc01d66 (diff) | |
download | accel-ppp-97ea33f5e749196d216f49f4dbfe7cbc89fe02b7.tar.gz accel-ppp-97ea33f5e749196d216f49f4dbfe7cbc89fe02b7.zip |
ipoe: do not set session's interface name if shared=1
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 607c7201..7d148b22 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -366,7 +366,7 @@ static char *ipoe_session_get_username(struct ipoe_session *ses) if (!ses->dhcpv4_request) return _strdup(ses->ctrl.calling_station_id); - return _strdup(ses->ses.ifname); + return _strdup(ses->serv->ifname); } static void l4_redirect_list_add(in_addr_t addr) @@ -609,8 +609,6 @@ static void ipoe_session_start(struct ipoe_session *ses) assert(!ses->ses.username); - strncpy(ses->ses.ifname, ses->serv->ifname, AP_IFNAME_LEN); - username = ipoe_session_get_username(ses); if (!username) { @@ -1201,7 +1199,9 @@ static struct ipoe_session *ipoe_session_create_dhcpv4(struct ipoe_serv *serv, s ses->serv = serv; ses->dhcpv4_request = pack; - strncpy(ses->ses.ifname, serv->ifname, AP_IFNAME_LEN); + + if (!serv->opt_shared) + strncpy(ses->ses.ifname, serv->ifname, AP_IFNAME_LEN); ses->xid = pack->hdr->xid; memcpy(ses->hwaddr, pack->hdr->chaddr, 6); |