aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/af_rose.c7
-rw-r--r--net/rose/rose_dev.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 7799fe82aeb6..d0a67bb31363 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -752,7 +752,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
752 752
753 rose_insert_socket(sk); /* Finish the bind */ 753 rose_insert_socket(sk); /* Finish the bind */
754 } 754 }
755 755rose_try_next_neigh:
756 rose->dest_addr = addr->srose_addr; 756 rose->dest_addr = addr->srose_addr;
757 rose->dest_call = addr->srose_call; 757 rose->dest_call = addr->srose_call;
758 rose->rand = ((long)rose & 0xFFFF) + rose->lci; 758 rose->rand = ((long)rose & 0xFFFF) + rose->lci;
@@ -810,6 +810,11 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
810 } 810 }
811 811
812 if (sk->sk_state != TCP_ESTABLISHED) { 812 if (sk->sk_state != TCP_ESTABLISHED) {
813 /* Try next neighbour */
814 rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
815 if (rose->neighbour)
816 goto rose_try_next_neigh;
817 /* No more neighbour */
813 sock->state = SS_UNCONNECTED; 818 sock->state = SS_UNCONNECTED;
814 return sock_error(sk); /* Always set at this point */ 819 return sock_error(sk); /* Always set at this point */
815 } 820 }
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 9d0bf2a1ea3f..7c279e2659ec 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -59,6 +59,7 @@ static int rose_rebuild_header(struct sk_buff *skb)
59 struct net_device_stats *stats = netdev_priv(dev); 59 struct net_device_stats *stats = netdev_priv(dev);
60 unsigned char *bp = (unsigned char *)skb->data; 60 unsigned char *bp = (unsigned char *)skb->data;
61 struct sk_buff *skbn; 61 struct sk_buff *skbn;
62 unsigned int len;
62 63
63#ifdef CONFIG_INET 64#ifdef CONFIG_INET
64 if (arp_find(bp + 7, skb)) { 65 if (arp_find(bp + 7, skb)) {
@@ -75,6 +76,8 @@ static int rose_rebuild_header(struct sk_buff *skb)
75 76
76 kfree_skb(skb); 77 kfree_skb(skb);
77 78
79 len = skbn->len;
80
78 if (!rose_route_frame(skbn, NULL)) { 81 if (!rose_route_frame(skbn, NULL)) {
79 kfree_skb(skbn); 82 kfree_skb(skbn);
80 stats->tx_errors++; 83 stats->tx_errors++;
@@ -82,7 +85,7 @@ static int rose_rebuild_header(struct sk_buff *skb)
82 } 85 }
83 86
84 stats->tx_packets++; 87 stats->tx_packets++;
85 stats->tx_bytes += skbn->len; 88 stats->tx_bytes += len;
86#endif 89#endif
87 return 1; 90 return 1;
88} 91}