summaryrefslogtreecommitdiffstats
path: root/include/net/llc_pdu.h
diff options
context:
space:
mode:
authorJoonwoo Park2008-04-01 06:02:47 +0200
committerDavid S. Miller2008-04-01 06:02:47 +0200
commitf83f1768f833cb45bc93429fdc552252a4f55ac3 (patch)
tree15de7d2df2fc3a35e0a6b933bb37aefcba2cc3ef /include/net/llc_pdu.h
parent[IP] UDP: Use SEQ_START_TOKEN. (diff)
downloadkernel-qcow2-linux-f83f1768f833cb45bc93429fdc552252a4f55ac3.tar.gz
kernel-qcow2-linux-f83f1768f833cb45bc93429fdc552252a4f55ac3.tar.xz
kernel-qcow2-linux-f83f1768f833cb45bc93429fdc552252a4f55ac3.zip
[LLC]: skb allocation size for responses
Allocate the skb for llc responses with the received packet size by using the size adjustable llc_frame_alloc. Don't allocate useless extra payload. Cleanup magic numbers. So, this fixes oops. Reported by Jim Westfall: kernel: skb_over_panic: text:c0541fc7 len:1000 put:997 head:c166ac00 data:c166ac2f tail:0xc166b017 end:0xc166ac80 dev:eth0 kernel: ------------[ cut here ]------------ kernel: kernel BUG at net/core/skbuff.c:95! Signed-off-by: Joonwoo Park <joonwpark81@gmail.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/llc_pdu.h')
-rw-r--r--include/net/llc_pdu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h
index 4a8f58b17e43..75b8e2968c9b 100644
--- a/include/net/llc_pdu.h
+++ b/include/net/llc_pdu.h
@@ -381,7 +381,7 @@ static inline void llc_pdu_init_as_xid_cmd(struct sk_buff *skb,
xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */
xid_info->type = svcs_supported;
xid_info->rw = rx_window << 1; /* size of receive window */
- skb_put(skb, 3);
+ skb_put(skb, sizeof(struct llc_xid_info));
}
/**
@@ -406,7 +406,7 @@ static inline void llc_pdu_init_as_xid_rsp(struct sk_buff *skb,
xid_info->fmt_id = LLC_XID_FMT_ID;
xid_info->type = svcs_supported;
xid_info->rw = rx_window << 1;
- skb_put(skb, 3);
+ skb_put(skb, sizeof(struct llc_xid_info));
}
/* LLC Type 2 FRMR response information field format */