X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Frose%2Frose_subr.c;h=36a77944622b8bd59bf51cdf424919712db5ddef;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=4c3f3c7f08a888faa2fad5fc37e310901023eae4;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c index 4c3f3c7f0..36a779446 100644 --- a/net/rose/rose_subr.c +++ b/net/rose/rose_subr.c @@ -21,13 +21,15 @@ #include #include #include -#include +#include #include #include #include #include #include +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);