summaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
commit95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch)
tree27a92a942821cde1edda9a1b088718d436b3efe4 /net/rose
parent45b27b0a0652331d104c953a5b192d843fff88f8 (diff)
Merge with Linux 2.3.40.
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/af_rose.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index ba8dd2041..0cab1224d 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -20,6 +20,7 @@
* ROSE 003 Jonathan(G4KLX) New timer architecture.
* Implemented idle timer.
* Added use count to neighbour.
+ * Tomi(OH2BNS) Fixed rose_getname().
*/
#include <linux/config.h>
@@ -893,7 +894,7 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags)
static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
- struct sockaddr_rose *srose = (struct sockaddr_rose *)uaddr;
+ struct full_sockaddr_rose *srose = (struct full_sockaddr_rose *)uaddr;
struct sock *sk = sock->sk;
int n;
@@ -901,42 +902,21 @@ static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
if (sk->state != TCP_ESTABLISHED)
return -ENOTCONN;
srose->srose_family = AF_ROSE;
- srose->srose_ndigis = 0;
srose->srose_addr = sk->protinfo.rose->dest_addr;
srose->srose_call = sk->protinfo.rose->dest_call;
srose->srose_ndigis = sk->protinfo.rose->dest_ndigis;
- if (*uaddr_len >= sizeof(struct full_sockaddr_rose)) {
- struct full_sockaddr_rose *full_srose = (struct full_sockaddr_rose *)uaddr;
- for (n = 0 ; n < sk->protinfo.rose->dest_ndigis ; n++)
- full_srose->srose_digis[n] = sk->protinfo.rose->dest_digis[n];
- *uaddr_len = sizeof(struct full_sockaddr_rose);
- } else {
- if (sk->protinfo.rose->dest_ndigis >= 1) {
- srose->srose_ndigis = 1;
- srose->srose_digi = sk->protinfo.rose->dest_digis[0];
- }
- *uaddr_len = sizeof(struct sockaddr_rose);
- }
+ for (n = 0 ; n < sk->protinfo.rose->dest_ndigis ; n++)
+ srose->srose_digis[n] = sk->protinfo.rose->dest_digis[n];
} else {
srose->srose_family = AF_ROSE;
- srose->srose_ndigis = 0;
srose->srose_addr = sk->protinfo.rose->source_addr;
srose->srose_call = sk->protinfo.rose->source_call;
srose->srose_ndigis = sk->protinfo.rose->source_ndigis;
- if (*uaddr_len >= sizeof(struct full_sockaddr_rose)) {
- struct full_sockaddr_rose *full_srose = (struct full_sockaddr_rose *)uaddr;
- for (n = 0 ; n < sk->protinfo.rose->source_ndigis ; n++)
- full_srose->srose_digis[n] = sk->protinfo.rose->source_digis[n];
- *uaddr_len = sizeof(struct full_sockaddr_rose);
- } else {
- if (sk->protinfo.rose->source_ndigis >= 1) {
- srose->srose_ndigis = 1;
- srose->srose_digi = sk->protinfo.rose->source_digis[sk->protinfo.rose->source_ndigis-1];
- }
- *uaddr_len = sizeof(struct sockaddr_rose);
- }
+ for (n = 0 ; n < sk->protinfo.rose->source_ndigis ; n++)
+ srose->srose_digis[n] = sk->protinfo.rose->source_digis[n];
}
+ *uaddr_len = sizeof(struct full_sockaddr_rose);
return 0;
}