From: Francois Romieu <romieu@cogenit.fr>
To: Maksim Krasnyanskiy <maxk@qualcomm.com>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
marcelo Tosatti <marcelo@conectiva.com.br>,
Alan@lxorguk.ukuu.org.uk, cell@sch.bme.hu,
linux-atm-general@lists.sourceforge.net
Subject: Re: [PATCH] Updated ATM patch for 2.4.19-pre4
Date: Sun, 24 Mar 2002 22:06:22 +0100 [thread overview]
Message-ID: <20020324220622.A1054@fafner.intra.cogenit.fr> (raw)
In-Reply-To: <5.1.0.14.2.20020322170653.0337b970@mail1.qualcomm.com> <20020323221058.B15111@fafner.intra.cogenit.fr>
[thread starts at:
http://www.cs.Helsinki.FI/linux/linux-kernel/2002-11/1311.html]
The following patch applies on top of Maksim's one. It:
- adds a missing include (hunk #1);
- turns a cast fiesta into the equivalent list_entry (hunk #2);
- unregisters net_device once it isn't needed for bridging (hunk #3);
- compiles and stands a kill-br2684ctl-before-ifconfig-down test: nas0
disappeared as it should.
Without the patch an oops happens, see:
<URL:http://www.cogenit.fr/linux/atm/oopses/text-6>
Comments welcome.
--- net/atm/br2684.c.orig Sat Mar 23 21:21:41 2002
+++ net/atm/br2684.c Sun Mar 24 21:42:30 2002
@@ -15,6 +15,7 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hun
#include <linux/etherdevice.h>
#include <net/arp.h>
#include <linux/rtnetlink.h>
+#include <linux/ip.h>
#include <linux/atmbr2684.h>
#include "ipcommon.h"
@@ -97,8 +98,7 @@ static LIST_HEAD(br2684_devs);
static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
{
- return (struct br2684_dev *) ((char *) (net_dev) -
- (unsigned long) (&((struct br2684_dev *) 0)->net_dev));
+ return list_entry(net_dev, struct br2684_dev, net_dev);
}
static inline struct br2684_dev *list_entry_brdev(const struct list_head *le)
@@ -410,6 +410,13 @@ static void br2684_push(struct atm_vcc *
if (skb == NULL) { /* skb==NULL means VCC is being destroyed */
br2684_close_vcc(brvcc);
+ if (list_empty(&brdev->brvccs)) {
+ read_lock(&devs_lock);
+ list_del(&brdev->br2684_devs);
+ read_unlock(&devs_lock);
+ unregister_netdev(&brdev->net_dev);
+ kfree(brdev);
+ }
return;
}
--
Ueimor
next prev parent reply other threads:[~2002-03-24 21:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-23 1:15 Maksim Krasnyanskiy
2002-03-23 1:54 ` Mr. James W. Laferriere
2002-03-23 1:58 ` Mr. James W. Laferriere
2002-03-23 21:10 ` Francois Romieu
2002-03-24 21:06 ` Francois Romieu [this message]
2002-03-25 21:53 ` [Linux-ATM-General] " Maksim Krasnyanskiy
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=20020324220622.A1054@fafner.intra.cogenit.fr \
--to=romieu@cogenit.fr \
--cc=Alan@lxorguk.ukuu.org.uk \
--cc=cell@sch.bme.hu \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=maxk@qualcomm.com \
/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
all inboxes | Powered by JetHome®