diff -ruN --exclude-from exclude linux.orig/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c --- linux.orig/net/ax25/af_ax25.c Mon Aug 9 22:04:41 1999 +++ linux/net/ax25/af_ax25.c Tue Sep 14 22:20:23 1999 @@ -95,6 +95,7 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. * AX.25 038 Matthias(DG2FEF) Small fixes to the syscall interface to make kernel * independent of AX25_MAX_DIGIS used by applications. + * Tomi(OH2BNS) Fixed ax25_getname(). */ #include @@ -1278,37 +1279,34 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sock *sk = sock->sk; + struct full_sockaddr_ax25 *fsa = (struct full_sockaddr_ax25 *)uaddr; unsigned char ndigi, i; - struct full_sockaddr_ax25 fsa; if (peer != 0) { if (sk->state != TCP_ESTABLISHED) return -ENOTCONN; - fsa.fsa_ax25.sax25_family = AF_AX25; - fsa.fsa_ax25.sax25_call = sk->protinfo.ax25->dest_addr; - fsa.fsa_ax25.sax25_ndigis = 0; + fsa->fsa_ax25.sax25_family = AF_AX25; + fsa->fsa_ax25.sax25_call = sk->protinfo.ax25->dest_addr; + fsa->fsa_ax25.sax25_ndigis = 0; if (sk->protinfo.ax25->digipeat != NULL) { ndigi = sk->protinfo.ax25->digipeat->ndigi; - fsa.fsa_ax25.sax25_ndigis = ndigi; + fsa->fsa_ax25.sax25_ndigis = ndigi; for (i = 0; i < ndigi; i++) - fsa.fsa_digipeater[i] = sk->protinfo.ax25->digipeat->calls[i]; + fsa->fsa_digipeater[i] = sk->protinfo.ax25->digipeat->calls[i]; } } else { - fsa.fsa_ax25.sax25_family = AF_AX25; - fsa.fsa_ax25.sax25_call = sk->protinfo.ax25->source_addr; - fsa.fsa_ax25.sax25_ndigis = 1; + fsa->fsa_ax25.sax25_family = AF_AX25; + fsa->fsa_ax25.sax25_call = sk->protinfo.ax25->source_addr; + fsa->fsa_ax25.sax25_ndigis = 1; if (sk->protinfo.ax25->ax25_dev != NULL) { - memcpy(&fsa.fsa_digipeater[0], sk->protinfo.ax25->ax25_dev->dev->dev_addr, AX25_ADDR_LEN); + memcpy(&fsa->fsa_digipeater[0], sk->protinfo.ax25->ax25_dev->dev->dev_addr, AX25_ADDR_LEN); } else { - fsa.fsa_digipeater[0] = null_ax25_address; + fsa->fsa_digipeater[0] = null_ax25_address; } } - if (*uaddr_len > sizeof (struct full_sockaddr_ax25)) - *uaddr_len = sizeof (struct full_sockaddr_ax25); - memcpy(uaddr, &fsa, *uaddr_len); - + *uaddr_len = sizeof (struct full_sockaddr_ax25); return 0; } diff -ruN --exclude-from exclude linux.orig/net/ax25/ax25_timer.c linux/net/ax25/ax25_timer.c --- linux.orig/net/ax25/ax25_timer.c Thu May 21 04:55:17 1998 +++ linux/net/ax25/ax25_timer.c Tue Sep 14 22:21:54 1999 @@ -22,6 +22,7 @@ * Joerg(DL1BKE) Fixed DAMA Slave. We are *required* to start with * standard AX.25 mode. * AX.25 037 Jonathan(G4KLX) New timer architecture. + * Tomi(OH2BNS) Fixed heartbeat expiry (check ax25_dev). */ #include @@ -153,8 +154,12 @@ static void ax25_heartbeat_expiry(unsigned long param) { ax25_cb *ax25 = (ax25_cb *)param; + int proto = AX25_PROTO_STD_SIMPLEX; - switch (ax25->ax25_dev->values[AX25_VALUES_PROTOCOL]) { + if (ax25->ax25_dev) + proto = ax25->ax25_dev->values[AX25_VALUES_PROTOCOL]; + + switch (proto) { case AX25_PROTO_STD_SIMPLEX: case AX25_PROTO_STD_DUPLEX: ax25_std_heartbeat_expiry(ax25); diff -ruN --exclude-from exclude linux.orig/net/netrom/nr_loopback.c linux/net/netrom/nr_loopback.c --- linux.orig/net/netrom/nr_loopback.c Fri Oct 9 21:56:59 1998 +++ linux/net/netrom/nr_loopback.c Tue Sep 14 22:24:08 1999 @@ -11,6 +11,7 @@ * * History * NET/ROM 007 Tomi(OH2BNS) Created this file. + * Small change in nr_loopback_queue(). * */ @@ -44,17 +45,17 @@ { struct sk_buff *skbn; - skbn = skb_clone(skb, GFP_ATOMIC); + if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) { + memcpy(skb_put(skbn, skb->len), skb->data, skb->len); + skbn->h.raw = skbn->data; - kfree_skb(skb); - - if (skbn != NULL) { skb_queue_tail(&loopback_queue, skbn); if (!nr_loopback_running()) nr_set_loopback_timer(); } + kfree_skb(skb); return 1; } Binary files linux.orig/net/network.a and linux/net/network.a differ diff -ruN --exclude-from exclude linux.orig/net/rose/af_rose.c linux/net/rose/af_rose.c --- linux.orig/net/rose/af_rose.c Mon Aug 9 22:04:41 1999 +++ linux/net/rose/af_rose.c Tue Sep 14 22:22:56 1999 @@ -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 @@ -898,7 +899,7 @@ 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; @@ -906,42 +907,21 @@ 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; }