diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /net/x25/x25_out.c | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'net/x25/x25_out.c')
-rw-r--r-- | net/x25/x25_out.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index 24fdf4d47..077f2c0b4 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c @@ -15,6 +15,7 @@ * History * X.25 001 Jonathan Naylor Started coding. * X.25 002 Jonathan Naylor New timer architecture. + * 2000-09-04 Henner Eisen Prevented x25_output() skb leakage. */ #include <linux/config.h> @@ -56,7 +57,7 @@ static int x25_pacsize_to_bytes(unsigned int pacsize) /* * This is where all X.25 information frames pass; */ -void x25_output(struct sock *sk, struct sk_buff *skb) +int x25_output(struct sock *sk, struct sk_buff *skb) { struct sk_buff *skbn; unsigned char header[X25_EXT_MIN_LEN]; @@ -73,9 +74,12 @@ void x25_output(struct sock *sk, struct sk_buff *skb) frontlen = skb_headroom(skb); while (skb->len > 0) { - if ((skbn = sock_alloc_send_skb(sk, frontlen + max_len, 0, 0, &err)) == NULL) - return; - + if ((skbn = sock_alloc_send_skb(sk, frontlen + max_len, 0, 0, &err)) == NULL){ + int unsent = skb->len - header_len; + SOCK_DEBUG(sk, "x25_output: framgent allocation failed, err=%d, %d bytes unsent\n", err, unsent); + return err; + } + skb_reserve(skbn, frontlen); len = (max_len > skb->len) ? skb->len : max_len; @@ -102,6 +106,7 @@ void x25_output(struct sock *sk, struct sk_buff *skb) } else { skb_queue_tail(&sk->write_queue, skb); } + return 0; } /* |