summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2009-11-26 17:37:41 +0000
committerThomas Osterried <thomas@osterried.de>2009-11-26 17:37:41 +0000
commit45d3d4eafd4ebae34ca53841e9427b2091db387b (patch)
treed3f8b5d065128449c0d1e30fc7725a4a653bd1ef
parent24b463104d183755b540f966ee2fee4d891589e2 (diff)
patch submitted by Bernard Pidoux f6bvp
- in proc_ax25 structure timers members size declared in procutils.h. Since in kernel 2.6 the timers are now in milliseconds, they need more place to be saved (unsigned short --> unsigned long). - in procutils.h and procutils.c in structure proc_rs_neigh field "use" was missing, in function read_proc_rs_neigh proc_rs_neigh use was not read
-rw-r--r--netax25/procutils.h39
-rw-r--r--procutils.c39
2 files changed, 40 insertions, 38 deletions
diff --git a/netax25/procutils.h b/netax25/procutils.h
index eabea20..25b31e8 100644
--- a/netax25/procutils.h
+++ b/netax25/procutils.h
@@ -55,13 +55,13 @@ struct proc_ax25 {
int ndigi;
unsigned char st;
unsigned short vs, vr, va;
- unsigned short t1, t1timer, t2, t2timer, t3, t3timer;
- unsigned short idle, idletimer;
- unsigned char n2, n2count;
- unsigned short rtt;
+ unsigned long t1timer, t1, t2timer, t2, t3timer, t3;
+ unsigned long idletimer, idle;
+ unsigned char n2count, n2;
+ unsigned long rtt;
unsigned char window;
unsigned short paclen;
- unsigned long sndq, rcvq;
+ unsigned short sndq, rcvq;
unsigned long inode;
struct proc_ax25 *next;
@@ -73,11 +73,11 @@ struct proc_nr {
char my_circuit[6], ur_circuit[6];
unsigned char st;
unsigned short vs, vr, va;
- unsigned short t1, t1timer, t2, t2timer, t4, t4timer;
- unsigned short idle, idletimer;
- unsigned char n2, n2count;
+ unsigned long t1timer, t1, t2timer, t2, t4timer, t4;
+ unsigned long idletimer, idle;
+ unsigned char n2count, n2;
unsigned char window;
- unsigned long sndq, rcvq;
+ unsigned short sndq, rcvq;
unsigned long inode;
struct proc_nr *next;
@@ -120,33 +120,34 @@ struct proc_rs {
};
struct proc_rs_route {
- unsigned short lci1;
+ unsigned short lci1;
char address1[11], call1[10];
- unsigned int neigh1;
- unsigned short lci2;
+ unsigned int neigh1;
+ unsigned short lci2;
char address2[11], call2[10];
- unsigned int neigh2;
+ unsigned int neigh2;
struct proc_rs_route *next;
};
struct proc_rs_neigh {
- int addr;
+ int addr;
char call[10];
char dev[14];
- int count;
+ unsigned int count;
+ unsigned int use;
char mode[4];
char restart[4];
- unsigned short t0, tf;
+ unsigned short t0, tf;
struct proc_rs_neigh *next;
};
struct proc_rs_nodes {
char address[11];
- unsigned char mask;
- unsigned char n;
- unsigned int neigh1, neigh2, neigh3;
+ unsigned char mask;
+ unsigned char n;
+ unsigned int neigh1, neigh2, neigh3;
struct proc_rs_nodes *next;
};
diff --git a/procutils.c b/procutils.c
index bb65ffe..de128d5 100644
--- a/procutils.c
+++ b/procutils.c
@@ -117,22 +117,22 @@ struct proc_ax25 *read_proc_ax25(void)
p->vr = safe_atoi(token(&cp, space));
p->va = safe_atoi(token(&cp, space));
- p->t1timer = safe_atoi(token(&cp, space));
- p->t1 = safe_atoi(token(&cp, space));
+ p->t1timer = safe_atox(token(&cp, space));
+ p->t1 = safe_atox(token(&cp, space));
- p->t2timer = safe_atoi(token(&cp, space));
- p->t2 = safe_atoi(token(&cp, space));
+ p->t2timer = safe_atox(token(&cp, space));
+ p->t2 = safe_atox(token(&cp, space));
- p->t3timer = safe_atoi(token(&cp, space));
- p->t3 = safe_atoi(token(&cp, space));
+ p->t3timer = safe_atox(token(&cp, space));
+ p->t3 = safe_atox(token(&cp, space));
- p->idletimer = safe_atoi(token(&cp, space));
- p->idle = safe_atoi(token(&cp, space));
+ p->idletimer = safe_atox(token(&cp, space));
+ p->idle = safe_atox(token(&cp, space));
p->n2count = safe_atoi(token(&cp, space));
p->n2 = safe_atoi(token(&cp, space));
- p->rtt = safe_atoi(token(&cp, space));
+ p->rtt = safe_atox(token(&cp, space));
p->window = safe_atoi(token(&cp, space));
@@ -141,7 +141,7 @@ struct proc_ax25 *read_proc_ax25(void)
p->sndq = safe_atoi(token(&cp, space));
p->rcvq = safe_atoi(token(&cp, space));
- p->inode = safe_atoi(token(&cp, space));
+ p->inode = safe_atox(token(&cp, space));
p->next = list;
list = p;
@@ -244,21 +244,21 @@ struct proc_nr *read_proc_nr(void)
p->vr = safe_atoi(token(&cp, space));
p->va = safe_atoi(token(&cp, space));
- p->t1timer = safe_atoi(token(&cp, "/"));
- p->t1 = safe_atoi(token(&cp, "/ \t\r\n"));
- p->t2timer = safe_atoi(token(&cp, "/"));
- p->t2 = safe_atoi(token(&cp, "/ \t\r\n"));
- p->t4timer = safe_atoi(token(&cp, "/"));
- p->t4 = safe_atoi(token(&cp, "/ \t\r\n"));
- p->idletimer = safe_atoi(token(&cp, "/"));
- p->idle = safe_atoi(token(&cp, "/ \t\r\n"));
+ p->t1timer = safe_atox(token(&cp, "/"));
+ p->t1 = safe_atox(token(&cp, "/ \t\r\n"));
+ p->t2timer = safe_atox(token(&cp, "/"));
+ p->t2 = safe_atox(token(&cp, "/ \t\r\n"));
+ p->t4timer = safe_atox(token(&cp, "/"));
+ p->t4 = safe_atox(token(&cp, "/ \t\r\n"));
+ p->idletimer = safe_atox(token(&cp, "/"));
+ p->idle = safe_atox(token(&cp, "/ \t\r\n"));
p->n2count = safe_atoi(token(&cp, "/"));
p->n2 = safe_atoi(token(&cp, "/ \t\r\n"));
p->window = safe_atoi(token(&cp, space));
p->sndq = safe_atoi(token(&cp, space));
p->rcvq = safe_atoi(token(&cp, space));
- p->inode = safe_atoi(token(&cp, space));
+ p->inode = safe_atox(token(&cp, space));
p->next = list;
list = p;
@@ -495,6 +495,7 @@ struct proc_rs_neigh *read_proc_rs_neigh(void)
safe_strncpy(p->call, strtok(NULL, " \t\n\r"), 9);
safe_strncpy(p->dev, strtok(NULL, " \t\n\r"), 13);
p->count = safe_atoi(strtok(NULL, " \t\n\r"));
+ p->use = safe_atoi(strtok(NULL, " \t\n\r"));
safe_strncpy(p->mode, strtok(NULL, " \t\n\r"), 3);
safe_strncpy(p->restart, strtok(NULL, " \t\n\r"), 3);
p->t0 = safe_atoi(strtok(NULL, " \t\n\r"));