Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103006
b: refs/heads/master
c: fe2c802
h: refs/heads/master
v: v3
  • Loading branch information
Bernard Pidoux authored and David S. Miller committed Jun 18, 2008
1 parent 7e5ab9b commit 49b0f50
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e92481f95375aa2702ea5018b0295792ae0fa9c1
refs/heads/master: fe2c802ab62aa63d276deafa905875f3455f2621
2 changes: 1 addition & 1 deletion trunk/include/net/rose.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern void rose_link_device_down(struct net_device *);
extern struct net_device *rose_dev_first(void);
extern struct net_device *rose_dev_get(rose_address *);
extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *);
extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *);
extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *, int);
extern int rose_rt_ioctl(unsigned int, void __user *);
extern void rose_link_failed(ax25_cb *, int);
extern int rose_route_frame(struct sk_buff *, ax25_cb *);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/rose/af_rose.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
sock->state = SS_UNCONNECTED;

rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause,
&diagnostic);
&diagnostic, 0);
if (!rose->neighbour) {
err = -ENETUNREACH;
goto out_release;
Expand Down Expand Up @@ -853,7 +853,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le

if (sk->sk_state != TCP_ESTABLISHED) {
/* Try next neighbour */
rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic, 0);
if (rose->neighbour)
goto rose_try_next_neigh;

Expand Down
29 changes: 18 additions & 11 deletions trunk/net/rose/rose_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,27 +662,34 @@ struct rose_route *rose_route_free_lci(unsigned int lci, struct rose_neigh *neig
}

/*
* Find a neighbour given a ROSE address.
* Find a neighbour or a route given a ROSE address.
*/
struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause,
unsigned char *diagnostic)
unsigned char *diagnostic, int new)
{
struct rose_neigh *res = NULL;
struct rose_node *node;
int failed = 0;
int i;

spin_lock_bh(&rose_node_list_lock);
if (!new) spin_lock_bh(&rose_node_list_lock);
for (node = rose_node_list; node != NULL; node = node->next) {
if (rosecmpm(addr, &node->address, node->mask) == 0) {
for (i = 0; i < node->count; i++) {
if (!rose_ftimer_running(node->neighbour[i])) {
res = node->neighbour[i];
goto out;
} else
failed = 1;
if (new) {
if (node->neighbour[i]->restarted) {
res = node->neighbour[i];
goto out;
}
}
else {
if (!rose_ftimer_running(node->neighbour[i])) {
res = node->neighbour[i];
goto out;
} else
failed = 1;
}
}
break;
}
}

Expand All @@ -695,7 +702,7 @@ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause,
}

out:
spin_unlock_bh(&rose_node_list_lock);
if (!new) spin_unlock_bh(&rose_node_list_lock);

return res;
}
Expand Down Expand Up @@ -1018,7 +1025,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
rose_route = rose_route->next;
}

if ((new_neigh = rose_get_neigh(dest_addr, &cause, &diagnostic)) == NULL) {
if ((new_neigh = rose_get_neigh(dest_addr, &cause, &diagnostic, 1)) == NULL) {
rose_transmit_clear_request(rose_neigh, lci, cause, diagnostic);
goto out;
}
Expand Down

0 comments on commit 49b0f50

Please sign in to comment.