Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
From: bernard pidoux <bpidoux@free.fr>
To: linux-hams <linux-hams@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Thomas Osterried DL9SAU <ax25@x-berg.in-berlin.de>
Subject: libax25-0.0.12-rc2 patch
Date: Sun, 18 Oct 2009 13:41:40 +0200	[thread overview]
Message-ID: <4ADAFEF4.9090709@free.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

Hi,

I noticed that "official" libax25 does not include patches introduced
into my "unofficial" libax25 versions a few months ago.

Thus, I send here the first set from my own work on libax25 .

   * BUG 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).
         Corrected, together with functions reading proc files in 
procutils.c.

    * BUG 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,

 -- Bernard Pidoux <f6bvp@amsat.org>  Jun 1 2008



[-- Attachment #2: libax25-0.0.12-rc2_procutils.patch --]
[-- Type: text/plain, Size: 5163 bytes --]

--- libax25-0.0.12-rc2/netax25/procutils.h	2009-06-21 00:53:51.000000000 +0200
+++ libax25-0.0.12-rc2/netax25/procutils.h	2008-07-10 21:32:18.000000000 +0200
@@ -55,13 +55,13 @@
 	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 @@
 	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_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;
 };
--- libax25-0.0.12-rc2/procutils.c	2009-06-21 00:54:50.000000000 +0200
+++ libax25-0.0.12-rc2/procutils.c	2008-07-10 21:32:18.000000000 +0200
@@ -117,22 +121,22 @@
 		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 +145,7 @@
 		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 +248,21 @@
 		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 +499,7 @@
 		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"));

                 reply	other threads:[~2009-10-18 11:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ADAFEF4.9090709@free.fr \
    --to=bpidoux@free.fr \
    --cc=ax25@x-berg.in-berlin.de \
    --cc=linux-hams@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox