diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-12-04 11:30:22 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-12-04 11:30:22 +0300 |
commit | 08f1d08a52039129fa8e41e23708a1e7d80a01b0 (patch) | |
tree | dbff75eb8c1a37010fa2bed0709eff19c278e6f3 | |
parent | 863694e6547b94488a077e500028aabaadc48086 (diff) | |
download | accel-ppp-08f1d08a52039129fa8e41e23708a1e7d80a01b0.tar.gz accel-ppp-08f1d08a52039129fa8e41e23708a1e7d80a01b0.zip |
ipoe: do not show ipoe-type for non ipoe sessions
-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 13709d0..a6dd277 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2179,12 +2179,15 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt, static void print_session_type(struct ap_session *s, char *buf) { - struct ipoe_session *ses = container_of(s, typeof(*ses), ses); + if (s->ctrl->type == CTRL_TYPE_IPOE) { + struct ipoe_session *ses = container_of(s, typeof(*ses), ses); - if (ses->UP) - strcpy(buf, "up"); - else - strcpy(buf, "dhcp"); + if (ses->UP) + strcpy(buf, "up"); + else + strcpy(buf, "dhcp"); + } else + *buf = 0; } void __export ipoe_get_stat(unsigned int **starting, unsigned int **active) |