Skip to content

Commit 597cdbc

Browse files
Eric Dumazetdavem330
authored andcommitted
atm: clip: remove clip_tbl
Commit 32092ec (atm: clip: Use device neigh support on top of "arp_tbl".) introduced a bug since clip_tbl is zeroed : Crash occurs in __neigh_for_each_release() idle_timer_check() must use instead arp_tbl and neigh_check_cb() should ignore non clip neighbours. Idea from David Miller. Reported-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Meelis Roos <mroos@linux.ee> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a5e7424 commit 597cdbc

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎net/atm/clip.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
static struct net_device *clip_devs;
4848
static struct atm_vcc *atmarpd;
49-
static struct neigh_table clip_tbl;
5049
static struct timer_list idle_timer;
50+
static const struct neigh_ops clip_neigh_ops;
5151

5252
static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
5353
{
@@ -123,6 +123,8 @@ static int neigh_check_cb(struct neighbour *n)
123123
struct atmarp_entry *entry = neighbour_priv(n);
124124
struct clip_vcc *cv;
125125

126+
if (n->ops != &clip_neigh_ops)
127+
return 0;
126128
for (cv = entry->vccs; cv; cv = cv->next) {
127129
unsigned long exp = cv->last_use + cv->idle_timeout;
128130

@@ -154,10 +156,10 @@ static int neigh_check_cb(struct neighbour *n)
154156

155157
static void idle_timer_check(unsigned long dummy)
156158
{
157-
write_lock(&clip_tbl.lock);
158-
__neigh_for_each_release(&clip_tbl, neigh_check_cb);
159+
write_lock(&arp_tbl.lock);
160+
__neigh_for_each_release(&arp_tbl, neigh_check_cb);
159161
mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ);
160-
write_unlock(&clip_tbl.lock);
162+
write_unlock(&arp_tbl.lock);
161163
}
162164

163165
static int clip_arp_rcv(struct sk_buff *skb)

0 commit comments

Comments
 (0)