X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Frose%2Frose_subr.c;h=36a77944622b8bd59bf51cdf424919712db5ddef;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=e2cd9d8c9b5b8cacae051d98f2d3443d6fdd21a5;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c index e2cd9d8c9..36a779446 100644 --- a/net/rose/rose_subr.c +++ b/net/rose/rose_subr.c @@ -21,14 +21,14 @@ #include #include #include -#include +#include #include #include #include #include #include -static int rose_create_facilities(unsigned char *buffer, rose_cb *rose); +static int rose_create_facilities(unsigned char *buffer, struct rose_sock *rose); /* * This routine purges all of the queues of frames. @@ -47,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. @@ -74,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; } } @@ -85,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) { @@ -102,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; @@ -337,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; @@ -396,10 +396,11 @@ int rose_parse_facilities(unsigned char *p, return 1; } -static 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 */ @@ -456,7 +457,7 @@ static 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; /* ??? */ @@ -471,7 +472,7 @@ static 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; /* ??? */ @@ -492,7 +493,7 @@ static 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);