summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-08-03 14:32:32 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-08-03 14:32:32 +0400
commitbc071ac4349a96ec757ee418c08ffac509e6b6e4 (patch)
treed41b9ed72de3979aa5a0a3e45789b9030ad98abe
parent95586a13a28c93e60f8da6b728b0e7b57cdff5f1 (diff)
downloadaccel-ppp-bc071ac4349a96ec757ee418c08ffac509e6b6e4.tar.gz
accel-ppp-bc071ac4349a96ec757ee418c08ffac509e6b6e4.zip
fixed complilation for 3.4 kernel
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c2
-rw-r--r--accel-pppd/extra/pppd_compat.c23
-rw-r--r--accel-pppd/logs/log_file.c1
-rw-r--r--accel-pppd/ppp/ppp_lcp.c16
-rw-r--r--accel-pppd/radius/dm_coa.c4
-rw-r--r--accel-pppd/radius/serv.c8
6 files changed, 20 insertions, 34 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 9608e9a..e4b414f 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -1139,7 +1139,7 @@ void pppoe_server_start(const char *opt, void *cli)
int f = 1;
struct ifreq ifr;
struct sockaddr_ll sa;
- char *ifname;
+ char *ifname = NULL;
int padi_limit = conf_padi_limit;
if (parse_server(opt, &ifname, &padi_limit)) {
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index fcb83c2..71934ab 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -18,6 +18,7 @@
#include "log.h"
#include "utils.h"
#include "sigchld.h"
+#include "iplink.h"
#ifdef RADIUS
#include "radius.h"
@@ -227,27 +228,19 @@ static void ev_ses_started(struct ap_session *ses)
static void ev_ses_finishing(struct ap_session *ses)
{
- struct ifpppstatsreq ifreq;
+ struct rtnl_link_stats stats;
struct pppd_compat_pd_t *pd = find_pd(ses);
if (!pd)
return;
- if (ses->ctrl->type == CTRL_TYPE_IPOE) {
-
- } else {
- memset(&ifreq, 0, sizeof(ifreq));
- ifreq.stats_ptr = (void *)&ifreq.stats;
- strcpy(ifreq.ifr__name, ses->ifname);
-
- if (ioctl(sock_fd, SIOCGPPPSTATS, &ifreq)) {
- log_ppp_error("pppd_compat: failed to get ppp statistics: %s\n", strerror(errno));
- return;
- }
-
- pd->bytes_sent = ifreq.stats.p.ppp_obytes;
- pd->bytes_rcvd = ifreq.stats.p.ppp_ibytes;
+ if (iplink_get_stats(ses->ifindex, &stats)) {
+ log_ppp_error("pppd_compat: failed to get interface statistics\n");
+ return;
}
+
+ pd->bytes_sent = stats.tx_bytes;
+ pd->bytes_rcvd = stats.rx_bytes;
}
static void ev_ses_finished(struct ap_session *ses)
diff --git a/accel-pppd/logs/log_file.c b/accel-pppd/logs/log_file.c
index 60d8eee..6dd7203 100644
--- a/accel-pppd/logs/log_file.c
+++ b/accel-pppd/logs/log_file.c
@@ -6,6 +6,7 @@
#include <unistd.h>
#include <limits.h>
#include <aio.h>
+#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c
index 0318e54..f3e8227 100644
--- a/accel-pppd/ppp/ppp_lcp.c
+++ b/accel-pppd/ppp/ppp_lcp.c
@@ -12,6 +12,7 @@
#include "ppp.h"
#include "ppp_lcp.h"
#include "events.h"
+#include "iplink.h"
#include "memdebug.h"
@@ -638,7 +639,7 @@ static void send_echo_reply(struct ppp_lcp_t *lcp)
static void send_echo_request(struct triton_timer_t *t)
{
struct ppp_lcp_t *lcp = container_of(t, typeof(*lcp), echo_timer);
- struct ifpppstatsreq ifreq;
+ struct rtnl_link_stats stats;
int f = 0;
time_t ts;
struct lcp_echo_req_t
@@ -657,20 +658,13 @@ static void send_echo_request(struct triton_timer_t *t)
if (conf_echo_timeout) {
if (lcp->echo_sent == 2) {
- memset(&ifreq, 0, sizeof(ifreq));
- ifreq.stats_ptr = (void *)&ifreq.stats;
- strcpy(ifreq.ifr__name, lcp->ppp->ses.ifname);
-
- if (ioctl(sock_fd, SIOCGPPPSTATS, &ifreq) == 0)
- lcp->last_ipackets = ifreq.stats.p.ppp_ipackets;
+ if (iplink_get_stats(lcp->ppp->ses.ifindex, &stats) == 0)
+ lcp->last_ipackets = stats.rx_packets;
time(&lcp->last_echo_ts);
} else if (lcp->echo_sent > 2) {
time(&ts);
- memset(&ifreq, 0, sizeof(ifreq));
- ifreq.stats_ptr = (void *)&ifreq.stats;
- strcpy(ifreq.ifr__name, lcp->ppp->ses.ifname);
- if (ioctl(sock_fd, SIOCGPPPSTATS, &ifreq) == 0 && lcp->last_ipackets != ifreq.stats.p.ppp_ipackets) {
+ if (iplink_get_stats(lcp->ppp->ses.ifindex, &stats) == 0 && lcp->last_ipackets != stats.rx_packets) {
lcp->echo_sent = 1;
lcp_update_echo_timer(lcp);
} else if (ts - lcp->last_echo_ts > conf_echo_timeout) {
diff --git a/accel-pppd/radius/dm_coa.c b/accel-pppd/radius/dm_coa.c
index 68ec0dc..13719ae 100644
--- a/accel-pppd/radius/dm_coa.c
+++ b/accel-pppd/radius/dm_coa.c
@@ -146,7 +146,7 @@ static void disconnect_request(struct radius_pd_t *rpd)
static void coa_request(struct radius_pd_t *rpd)
{
struct rad_attr_t *class;
- void *prev_class;
+ void *prev_class = rpd->attr_class;
struct ev_radius_t ev = {
.ses = rpd->ses,
.request = rpd->dm_coa_req,
@@ -164,8 +164,6 @@ static void coa_request(struct radius_pd_t *rpd)
else {
class = rad_packet_find_attr(rpd->dm_coa_req, NULL, "Class");
if (class) {
- prev_class = rpd->attr_class;
-
if (rpd->attr_class_len < class->len) {
if (rpd->attr_class)
_free(rpd->attr_class);
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index aae3719..f40725b 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -364,11 +364,11 @@ static void add_server_old(void)
{
const char *opt;
in_addr_t auth_addr = 0;
- int auth_port;
- char *auth_secret;
+ int auth_port = 0;
+ char *auth_secret = NULL;
in_addr_t acct_addr = 0;
- int acct_port;
- char *acct_secret;
+ int acct_port = 0;
+ char *acct_secret = NULL;
struct rad_server_t *s;
opt = conf_get_opt("radius", "auth-server");