aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/atmclip.h2
-rw-r--r--net/atm/clip.c28
2 files changed, 15 insertions, 15 deletions
diff --git a/include/net/atmclip.h b/include/net/atmclip.h
index 497ef6444a7a..852a3b2890ec 100644
--- a/include/net/atmclip.h
+++ b/include/net/atmclip.h
@@ -15,7 +15,6 @@
15 15
16 16
17#define CLIP_VCC(vcc) ((struct clip_vcc *) ((vcc)->user_back)) 17#define CLIP_VCC(vcc) ((struct clip_vcc *) ((vcc)->user_back))
18#define NEIGH2ENTRY(neigh) ((struct atmarp_entry *) (neigh)->primary_key)
19 18
20struct sk_buff; 19struct sk_buff;
21 20
@@ -36,7 +35,6 @@ struct clip_vcc {
36 35
37 36
38struct atmarp_entry { 37struct atmarp_entry {
39 __be32 ip; /* IP address */
40 struct clip_vcc *vccs; /* active VCCs; NULL if resolution is 38 struct clip_vcc *vccs; /* active VCCs; NULL if resolution is
41 pending */ 39 pending */
42 unsigned long expires; /* entry expiration time */ 40 unsigned long expires; /* entry expiration time */
diff --git a/net/atm/clip.c b/net/atm/clip.c
index b1c7ada83b83..a9d3484b1e71 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -119,7 +119,7 @@ out:
119/* The neighbour entry n->lock is held. */ 119/* The neighbour entry n->lock is held. */
120static int neigh_check_cb(struct neighbour *n) 120static int neigh_check_cb(struct neighbour *n)
121{ 121{
122 struct atmarp_entry *entry = NEIGH2ENTRY(n); 122 struct atmarp_entry *entry = neighbour_priv(n);
123 struct clip_vcc *cv; 123 struct clip_vcc *cv;
124 124
125 for (cv = entry->vccs; cv; cv = cv->next) { 125 for (cv = entry->vccs; cv; cv = cv->next) {
@@ -262,8 +262,10 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
262 262
263static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 263static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
264{ 264{
265 __be32 *ip = (__be32 *) neigh->primary_key;
266
265 pr_debug("(neigh %p, skb %p)\n", neigh, skb); 267 pr_debug("(neigh %p, skb %p)\n", neigh, skb);
266 to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip); 268 to_atmarpd(act_need, PRIV(neigh->dev)->number, *ip);
267} 269}
268 270
269static void clip_neigh_error(struct neighbour *neigh, struct sk_buff *skb) 271static void clip_neigh_error(struct neighbour *neigh, struct sk_buff *skb)
@@ -284,13 +286,13 @@ static const struct neigh_ops clip_neigh_ops = {
284 286
285static int clip_constructor(struct neighbour *neigh) 287static int clip_constructor(struct neighbour *neigh)
286{ 288{
287 struct atmarp_entry *entry = NEIGH2ENTRY(neigh); 289 struct atmarp_entry *entry = neighbour_priv(neigh);
288 struct net_device *dev = neigh->dev; 290 struct net_device *dev = neigh->dev;
289 struct in_device *in_dev; 291 struct in_device *in_dev;
290 struct neigh_parms *parms; 292 struct neigh_parms *parms;
291 293
292 pr_debug("(neigh %p, entry %p)\n", neigh, entry); 294 pr_debug("(neigh %p, entry %p)\n", neigh, entry);
293 neigh->type = inet_addr_type(&init_net, entry->ip); 295 neigh->type = inet_addr_type(&init_net, *((__be32 *) neigh->primary_key));
294 if (neigh->type != RTN_UNICAST) 296 if (neigh->type != RTN_UNICAST)
295 return -EINVAL; 297 return -EINVAL;
296 298
@@ -398,12 +400,12 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
398 dev->stats.tx_dropped++; 400 dev->stats.tx_dropped++;
399 return NETDEV_TX_OK; 401 return NETDEV_TX_OK;
400 } 402 }
401 entry = NEIGH2ENTRY(n); 403 entry = neighbour_priv(n);
402 if (!entry->vccs) { 404 if (!entry->vccs) {
403 if (time_after(jiffies, entry->expires)) { 405 if (time_after(jiffies, entry->expires)) {
404 /* should be resolved */ 406 /* should be resolved */
405 entry->expires = jiffies + ATMARP_RETRY_DELAY * HZ; 407 entry->expires = jiffies + ATMARP_RETRY_DELAY * HZ;
406 to_atmarpd(act_need, PRIV(dev)->number, entry->ip); 408 to_atmarpd(act_need, PRIV(dev)->number, *((__be32 *)n->primary_key));
407 } 409 }
408 if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS) 410 if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS)
409 skb_queue_tail(&entry->neigh->arp_queue, skb); 411 skb_queue_tail(&entry->neigh->arp_queue, skb);
@@ -510,7 +512,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
510 ip_rt_put(rt); 512 ip_rt_put(rt);
511 if (!neigh) 513 if (!neigh)
512 return -ENOMEM; 514 return -ENOMEM;
513 entry = NEIGH2ENTRY(neigh); 515 entry = neighbour_priv(neigh);
514 if (entry != clip_vcc->entry) { 516 if (entry != clip_vcc->entry) {
515 if (!clip_vcc->entry) 517 if (!clip_vcc->entry)
516 pr_debug("add\n"); 518 pr_debug("add\n");
@@ -771,9 +773,10 @@ static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr)
771/* This means the neighbour entry has no attached VCC objects. */ 773/* This means the neighbour entry has no attached VCC objects. */
772#define SEQ_NO_VCC_TOKEN ((void *) 2) 774#define SEQ_NO_VCC_TOKEN ((void *) 2)
773 775
774static void atmarp_info(struct seq_file *seq, struct net_device *dev, 776static void atmarp_info(struct seq_file *seq, struct neighbour *n,
775 struct atmarp_entry *entry, struct clip_vcc *clip_vcc) 777 struct atmarp_entry *entry, struct clip_vcc *clip_vcc)
776{ 778{
779 struct net_device *dev = n->dev;
777 unsigned long exp; 780 unsigned long exp;
778 char buf[17]; 781 char buf[17];
779 int svc, llc, off; 782 int svc, llc, off;
@@ -793,8 +796,7 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
793 seq_printf(seq, "%-6s%-4s%-4s%5ld ", 796 seq_printf(seq, "%-6s%-4s%-4s%5ld ",
794 dev->name, svc ? "SVC" : "PVC", llc ? "LLC" : "NULL", exp); 797 dev->name, svc ? "SVC" : "PVC", llc ? "LLC" : "NULL", exp);
795 798
796 off = scnprintf(buf, sizeof(buf) - 1, "%pI4", 799 off = scnprintf(buf, sizeof(buf) - 1, "%pI4", n->primary_key);
797 &entry->ip);
798 while (off < 16) 800 while (off < 16)
799 buf[off++] = ' '; 801 buf[off++] = ' ';
800 buf[off] = '\0'; 802 buf[off] = '\0';
@@ -865,7 +867,7 @@ static void *clip_seq_sub_iter(struct neigh_seq_state *_state,
865{ 867{
866 struct clip_seq_state *state = (struct clip_seq_state *)_state; 868 struct clip_seq_state *state = (struct clip_seq_state *)_state;
867 869
868 return clip_seq_vcc_walk(state, NEIGH2ENTRY(n), pos); 870 return clip_seq_vcc_walk(state, neighbour_priv(n), pos);
869} 871}
870 872
871static void *clip_seq_start(struct seq_file *seq, loff_t * pos) 873static void *clip_seq_start(struct seq_file *seq, loff_t * pos)
@@ -884,10 +886,10 @@ static int clip_seq_show(struct seq_file *seq, void *v)
884 seq_puts(seq, atm_arp_banner); 886 seq_puts(seq, atm_arp_banner);
885 } else { 887 } else {
886 struct clip_seq_state *state = seq->private; 888 struct clip_seq_state *state = seq->private;
887 struct neighbour *n = v;
888 struct clip_vcc *vcc = state->vcc; 889 struct clip_vcc *vcc = state->vcc;
890 struct neighbour *n = v;
889 891
890 atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); 892 atmarp_info(seq, n, neighbour_priv(n), vcc);
891 } 893 }
892 return 0; 894 return 0;
893} 895}