patch-1.3.7 linux/net/ax25/ax25_out.c
Next file: linux/net/ax25/ax25_route.c
Previous file: linux/net/ax25/ax25_in.c
Back to the patch index
Back to the overall index
- Lines: 41
- Date:
Wed Jul 5 13:06:27 1995
- Orig file:
v1.3.6/linux/net/ax25/ax25_out.c
- Orig date:
Tue Jun 6 12:16:43 1995
diff -u --recursive --new-file v1.3.6/linux/net/ax25/ax25_out.c linux/net/ax25/ax25_out.c
@@ -68,7 +68,7 @@
if (skb == NULL)
return;
- frame = skb->h.raw; /* KISS + header */
+ frame = skb_push(skb, 1); /* KISS + header */
*frame = I;
*frame |= poll_bit;
@@ -146,7 +146,7 @@
void ax25_transmit_buffer(ax25_cb *ax25, struct sk_buff *skb, int type)
{
- unsigned char *ptr = skb->data;
+ unsigned char *ptr;
if (ax25->device == NULL) {
if (ax25->sk != NULL) {
@@ -159,12 +159,19 @@
return;
}
- *ptr++ = 0; /* KISS data */
- ptr += build_ax25_addr(ptr, &ax25->source_addr, &ax25->dest_addr, ax25->digipeat, type);
+ if (skb_headroom(skb) < size_ax25_addr(ax25->digipeat)) {
+ printk("ax25_transmit_buffer: not enough room for digi-peaters\n");
+ skb->free = 1;
+ kfree_skb(skb, FREE_WRITE);
+ return;
+ }
+
+ ptr = skb_push(skb, size_ax25_addr(ax25->digipeat));
+ build_ax25_addr(ptr, &ax25->source_addr, &ax25->dest_addr, ax25->digipeat, type);
skb->arp = 1;
- dev_queue_xmit(skb, ax25->device, SOPRI_NORMAL);
+ ax25_queue_xmit(skb, ax25->device, SOPRI_NORMAL);
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this