Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / net / rose / rose_subr.c
index 4c3f3c7..36a7794 100644 (file)
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <net/tcp.h>
+#include <net/tcp_states.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <net/rose.h>
 
+static int rose_create_facilities(unsigned char *buffer, struct rose_sock *rose);
+
 /*
  *     This routine purges all of the queues of frames.
  */
@@ -45,7 +47,7 @@ void rose_clear_queues(struct sock *sk)
 void rose_frames_acked(struct sock *sk, unsigned short nr)
 {
        struct sk_buff *skb;
-       rose_cb *rose = rose_sk(sk);
+       struct rose_sock *rose = rose_sk(sk);
 
        /*
         * Remove all the ack-ed frames from the ack queue.
@@ -72,7 +74,7 @@ void rose_requeue_frames(struct sock *sk)
                if (skb_prev == NULL)
                        skb_queue_head(&sk->sk_write_queue, skb);
                else
-                       skb_append(skb_prev, skb);
+                       skb_append(skb_prev, skb, &sk->sk_write_queue);
                skb_prev = skb;
        }
 }
@@ -83,7 +85,7 @@ void rose_requeue_frames(struct sock *sk)
  */
 int rose_validate_nr(struct sock *sk, unsigned short nr)
 {
-       rose_cb *rose = rose_sk(sk);
+       struct rose_sock *rose = rose_sk(sk);
        unsigned short vc = rose->va;
 
        while (vc != rose->vs) {
@@ -100,7 +102,7 @@ int rose_validate_nr(struct sock *sk, unsigned short nr)
  */
 void rose_write_internal(struct sock *sk, int frametype)
 {
-       rose_cb *rose = rose_sk(sk);
+       struct rose_sock *rose = rose_sk(sk);
        struct sk_buff *skb;
        unsigned char  *dptr;
        unsigned char  lci1, lci2;
@@ -335,13 +337,13 @@ static int rose_parse_ccitt(unsigned char *p, struct rose_facilities_struct *fac
                                memcpy(&facilities->source_addr, p + 7, ROSE_ADDR_LEN);
                                memcpy(callsign, p + 12,   l - 10);
                                callsign[l - 10] = '\0';
-                               facilities->source_call = *asc2ax(callsign);
+                               asc2ax(&facilities->source_call, callsign);
                        }
                        if (*p == FAC_CCITT_SRC_NSAP) {
                                memcpy(&facilities->dest_addr, p + 7, ROSE_ADDR_LEN);
                                memcpy(callsign, p + 12, l - 10);
                                callsign[l - 10] = '\0';
-                               facilities->dest_call = *asc2ax(callsign);
+                               asc2ax(&facilities->dest_call, callsign);
                        }
                        p   += l + 2;
                        n   += l + 2;
@@ -394,10 +396,11 @@ int rose_parse_facilities(unsigned char *p,
        return 1;
 }
 
-int rose_create_facilities(unsigned char *buffer, rose_cb *rose)
+static int rose_create_facilities(unsigned char *buffer, struct rose_sock *rose)
 {
        unsigned char *p = buffer + 1;
        char *callsign;
+       char buf[11];
        int len, nb;
 
        /* National Facilities */
@@ -454,7 +457,7 @@ int rose_create_facilities(unsigned char *buffer, rose_cb *rose)
 
        *p++ = FAC_CCITT_DEST_NSAP;
 
-       callsign = ax2asc(&rose->dest_call);
+       callsign = ax2asc(buf, &rose->dest_call);
 
        *p++ = strlen(callsign) + 10;
        *p++ = (strlen(callsign) + 9) * 2;              /* ??? */
@@ -469,7 +472,7 @@ int rose_create_facilities(unsigned char *buffer, rose_cb *rose)
 
        *p++ = FAC_CCITT_SRC_NSAP;
 
-       callsign = ax2asc(&rose->source_call);
+       callsign = ax2asc(buf, &rose->source_call);
 
        *p++ = strlen(callsign) + 10;
        *p++ = (strlen(callsign) + 9) * 2;              /* ??? */
@@ -490,7 +493,7 @@ int rose_create_facilities(unsigned char *buffer, rose_cb *rose)
 
 void rose_disconnect(struct sock *sk, int reason, int cause, int diagnostic)
 {
-       rose_cb *rose = rose_sk(sk);
+       struct rose_sock *rose = rose_sk(sk);
 
        rose_stop_timer(sk);
        rose_stop_idletimer(sk);