aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-21 01:31:09 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:31:09 -0500
commit118b2c9532c853ebdf15c21128d30a343b89ea45 (patch)
tree1974a1850b4bfebb08424a241228ac66076c276f /net/dccp/ipv4.c
parente5a6de915ba9ba828751ade5d3e874072a89a00a (diff)
[DCCP]: Use sk->sk_prot->max_header consistently for non-data packets
Using this also provides opportunities for introducing inet_csk_alloc_skb that would call alloc_skb, account it to the sock and skb_reserve(max_header), but I'll leave this for later, for now using sk_prot->max_header consistently is enough. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7098f1055f4a..64b7f8bda42d 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -201,7 +201,7 @@ static void dccp_v4_ctl_send_ack(struct sk_buff *rxskb)
201{ 201{
202 int err; 202 int err;
203 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; 203 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
204 const int dccp_hdr_ack_len = sizeof(struct dccp_hdr) + 204 const u32 dccp_hdr_ack_len = sizeof(struct dccp_hdr) +
205 sizeof(struct dccp_hdr_ext) + 205 sizeof(struct dccp_hdr_ext) +
206 sizeof(struct dccp_hdr_ack_bits); 206 sizeof(struct dccp_hdr_ack_bits);
207 struct sk_buff *skb; 207 struct sk_buff *skb;
@@ -209,12 +209,12 @@ static void dccp_v4_ctl_send_ack(struct sk_buff *rxskb)
209 if (((struct rtable *)rxskb->dst)->rt_type != RTN_LOCAL) 209 if (((struct rtable *)rxskb->dst)->rt_type != RTN_LOCAL)
210 return; 210 return;
211 211
212 skb = alloc_skb(MAX_DCCP_HEADER + 15, GFP_ATOMIC); 212 skb = alloc_skb(dccp_v4_ctl_socket->sk->sk_prot->max_header, GFP_ATOMIC);
213 if (skb == NULL) 213 if (skb == NULL)
214 return; 214 return;
215 215
216 /* Reserve space for headers. */ 216 /* Reserve space for headers. */
217 skb_reserve(skb, MAX_DCCP_HEADER); 217 skb_reserve(skb, dccp_v4_ctl_socket->sk->sk_prot->max_header);
218 218
219 skb->dst = dst_clone(rxskb->dst); 219 skb->dst = dst_clone(rxskb->dst);
220 220
@@ -715,12 +715,13 @@ static void dccp_v4_ctl_send_reset(struct sk_buff *rxskb)
715 if (dst == NULL) 715 if (dst == NULL)
716 return; 716 return;
717 717
718 skb = alloc_skb(MAX_DCCP_HEADER + 15, GFP_ATOMIC); 718 skb = alloc_skb(dccp_v4_ctl_socket->sk->sk_prot->max_header,
719 GFP_ATOMIC);
719 if (skb == NULL) 720 if (skb == NULL)
720 goto out; 721 goto out;
721 722
722 /* Reserve space for headers. */ 723 /* Reserve space for headers. */
723 skb_reserve(skb, MAX_DCCP_HEADER); 724 skb_reserve(skb, dccp_v4_ctl_socket->sk->sk_prot->max_header);
724 skb->dst = dst_clone(dst); 725 skb->dst = dst_clone(dst);
725 726
726 skb->h.raw = skb_push(skb, dccp_hdr_reset_len); 727 skb->h.raw = skb_push(skb, dccp_hdr_reset_len);