* [2.6 patch] /net/ax25/: some cleanups
@ 2004-12-12 21:13 Adrian Bunk
2004-12-28 2:51 ` David S. Miller
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2004-12-12 21:13 UTC (permalink / raw)
To: ralf; +Cc: linux-hams, netdev, linux-kernel
The patch below contains the following cleanups:
- make two needlessly global functions static
- net/ax25/ax25_addr.c: remove the unused global function ax25digicmp
diffstat output:
include/net/ax25.h | 3 ---
net/ax25/af_ax25.c | 2 +-
net/ax25/ax25_addr.c | 20 --------------------
net/ax25/ax25_ds_subr.c | 2 +-
4 files changed, 2 insertions(+), 25 deletions(-)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.10-rc2-mm4-full/include/net/ax25.h.old 2004-12-12 18:56:04.000000000 +0100
+++ linux-2.6.10-rc2-mm4-full/include/net/ax25.h 2004-12-12 19:00:07.000000000 +0100
@@ -231,7 +231,6 @@
extern void ax25_destroy_socket(ax25_cb *);
extern ax25_cb *ax25_create_cb(void);
extern void ax25_fillin_cb(ax25_cb *, ax25_dev *);
-extern int ax25_create(struct socket *, int);
extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
/* ax25_addr.c */
@@ -239,7 +238,6 @@
extern char *ax2asc(ax25_address *);
extern ax25_address *asc2ax(char *);
extern int ax25cmp(ax25_address *, ax25_address *);
-extern int ax25digicmp(ax25_digi *, ax25_digi *);
extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *);
extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int);
extern int ax25_addr_size(ax25_digi *);
@@ -268,7 +266,6 @@
extern void ax25_ds_nr_error_recovery(ax25_cb *);
extern void ax25_ds_enquiry_response(ax25_cb *);
extern void ax25_ds_establish_data_link(ax25_cb *);
-extern void ax25_dev_dama_on(ax25_dev *);
extern void ax25_dev_dama_off(ax25_dev *);
extern void ax25_dama_on(ax25_cb *);
extern void ax25_dama_off(ax25_cb *);
--- linux-2.6.10-rc2-mm4-full/net/ax25/af_ax25.c.old 2004-12-12 18:55:30.000000000 +0100
+++ linux-2.6.10-rc2-mm4-full/net/ax25/af_ax25.c 2004-12-12 18:55:41.000000000 +0100
@@ -755,7 +755,7 @@
return res;
}
-int ax25_create(struct socket *sock, int protocol)
+static int ax25_create(struct socket *sock, int protocol)
{
struct sock *sk;
ax25_cb *ax25;
--- linux-2.6.10-rc2-mm4-full/net/ax25/ax25_addr.c.old 2004-12-12 18:56:23.000000000 +0100
+++ linux-2.6.10-rc2-mm4-full/net/ax25/ax25_addr.c 2004-12-12 18:56:32.000000000 +0100
@@ -121,26 +121,6 @@
}
/*
- * Compare two AX.25 digipeater paths.
- */
-int ax25digicmp(ax25_digi *digi1, ax25_digi *digi2)
-{
- int i;
-
- if (digi1->ndigi != digi2->ndigi)
- return 1;
-
- if (digi1->lastrepeat != digi2->lastrepeat)
- return 1;
-
- for (i = 0; i < digi1->ndigi; i++)
- if (ax25cmp(&digi1->calls[i], &digi2->calls[i]) != 0)
- return 1;
-
- return 0;
-}
-
-/*
* Given an AX.25 address pull of to, from, digi list, command/response and the start of data
*
*/
--- linux-2.6.10-rc2-mm4-full/net/ax25/ax25_ds_subr.c.old 2004-12-12 18:57:03.000000000 +0100
+++ linux-2.6.10-rc2-mm4-full/net/ax25/ax25_ds_subr.c 2004-12-12 18:57:45.000000000 +0100
@@ -174,7 +174,7 @@
return res;
}
-void ax25_dev_dama_on(ax25_dev *ax25_dev)
+static void ax25_dev_dama_on(ax25_dev *ax25_dev)
{
if (ax25_dev == NULL)
return;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] /net/ax25/: some cleanups
2004-12-12 21:13 [2.6 patch] /net/ax25/: some cleanups Adrian Bunk
@ 2004-12-28 2:51 ` David S. Miller
2004-12-28 14:27 ` Alan Cox
0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2004-12-28 2:51 UTC (permalink / raw)
To: Adrian Bunk; +Cc: ralf, linux-hams, netdev, linux-kernel
On Sun, 12 Dec 2004 22:13:39 +0100
Adrian Bunk <bunk@stusta.de> wrote:
> The patch below contains the following cleanups:
> - make two needlessly global functions static
> - net/ax25/ax25_addr.c: remove the unused global function ax25digicmp
Applied, thanks Adrian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] /net/ax25/: some cleanups
2004-12-28 2:51 ` David S. Miller
@ 2004-12-28 14:27 ` Alan Cox
2004-12-28 18:05 ` David S. Miller
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2004-12-28 14:27 UTC (permalink / raw)
To: David S. Miller
Cc: Adrian Bunk, ralf, linux-hams, netdev, Linux Kernel Mailing List
On Maw, 2004-12-28 at 02:51, David S. Miller wrote:
> On Sun, 12 Dec 2004 22:13:39 +0100
> Adrian Bunk <bunk@stusta.de> wrote:
>
> > The patch below contains the following cleanups:
> > - make two needlessly global functions static
> > - net/ax25/ax25_addr.c: remove the unused global function ax25digicmp
Dave this function is only unused because a patch in 2.6.10 broke AX.25
protocol support by removing the device and path checks. AX.25 is a link
layer protocol it is supposed to check the devices and arguably the
path.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] /net/ax25/: some cleanups
2004-12-28 14:27 ` Alan Cox
@ 2004-12-28 18:05 ` David S. Miller
2004-12-28 21:54 ` Alan Cox
0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2004-12-28 18:05 UTC (permalink / raw)
To: Alan Cox; +Cc: bunk, ralf, linux-hams, netdev, linux-kernel
On Tue, 28 Dec 2004 14:27:08 +0000
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Maw, 2004-12-28 at 02:51, David S. Miller wrote:
> > On Sun, 12 Dec 2004 22:13:39 +0100
> > Adrian Bunk <bunk@stusta.de> wrote:
> >
> > > The patch below contains the following cleanups:
> > > - make two needlessly global functions static
> > > - net/ax25/ax25_addr.c: remove the unused global function ax25digicmp
>
> Dave this function is only unused because a patch in 2.6.10 broke AX.25
> protocol support by removing the device and path checks. AX.25 is a link
> layer protocol it is supposed to check the devices and arguably the
> path.
Send a patch to netdev and CC: me to fix this as is standard
procedure for getting changes into the networking. :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] /net/ax25/: some cleanups
2004-12-28 18:05 ` David S. Miller
@ 2004-12-28 21:54 ` Alan Cox
0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2004-12-28 21:54 UTC (permalink / raw)
To: David S. Miller; +Cc: bunk, ralf, linux-hams, netdev, Linux Kernel Mailing List
On Maw, 2004-12-28 at 18:05, David S. Miller wrote:
> Send a patch to netdev and CC: me to fix this as is standard
> procedure for getting changes into the networking. :-)
Attached - revert to 2.6.9 behaviour.
I suspect given that someone made the change for a reason that there
should probably be a sysctl to switch between AX.25 (as 2.6.9) and "kind
of routed AX.25-ish" (as 2.6.10).
--- ../linux.vanilla-2.6.10/net/ax25/af_ax25.c 2004-12-25 21:15:46.000000000 +0000
+++ net/ax25/af_ax25.c 2004-12-26 22:07:44.000000000 +0000
@@ -207,8 +207,16 @@
continue;
if (s->ax25_dev == NULL)
continue;
- if (ax25cmp(&s->source_addr, src_addr) == 0 &&
- ax25cmp(&s->dest_addr, dest_addr) == 0) {
+ if (ax25cmp(&s->source_addr, src_addr) == 0 && ax25cmp(&s->dest_addr, dest_addr) == 0 && s->ax25_dev->dev == dev) {
+ if (digi != NULL && digi->ndigi != 0) {
+ if (s->digipeat == NULL)
+ continue;
+ if (ax25digicmp(s->digipeat, digi) != 0)
+ continue;
+ } else {
+ if (s->digipeat != NULL && s->digipeat->ndigi != 0)
+ continue;
+ }
ax25_cb_hold(s);
spin_unlock_bh(&ax25_list_lock);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-12-28 23:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-12 21:13 [2.6 patch] /net/ax25/: some cleanups Adrian Bunk
2004-12-28 2:51 ` David S. Miller
2004-12-28 14:27 ` Alan Cox
2004-12-28 18:05 ` David S. Miller
2004-12-28 21:54 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).