aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.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/ipv6.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/ipv6.c')
-rw-r--r--net/dccp/ipv6.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index f28f38fd0134..0f328c753c57 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -514,7 +514,7 @@ static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
514static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb) 514static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb)
515{ 515{
516 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; 516 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
517 const int dccp_hdr_reset_len = sizeof(struct dccp_hdr) + 517 const u32 dccp_hdr_reset_len = sizeof(struct dccp_hdr) +
518 sizeof(struct dccp_hdr_ext) + 518 sizeof(struct dccp_hdr_ext) +
519 sizeof(struct dccp_hdr_reset); 519 sizeof(struct dccp_hdr_reset);
520 struct sk_buff *skb; 520 struct sk_buff *skb;
@@ -527,18 +527,12 @@ static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb)
527 if (!ipv6_unicast_destination(rxskb)) 527 if (!ipv6_unicast_destination(rxskb))
528 return; 528 return;
529 529
530 /* 530 skb = alloc_skb(dccp_v6_ctl_socket->sk->sk_prot->max_header,
531 * We need to grab some memory, and put together an RST, 531 GFP_ATOMIC);
532 * and then put it into the queue to be sent.
533 */
534
535 skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) +
536 dccp_hdr_reset_len, GFP_ATOMIC);
537 if (skb == NULL) 532 if (skb == NULL)
538 return; 533 return;
539 534
540 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) + 535 skb_reserve(skb, dccp_v6_ctl_socket->sk->sk_prot->max_header);
541 dccp_hdr_reset_len);
542 536
543 skb->h.raw = skb_push(skb, dccp_hdr_reset_len); 537 skb->h.raw = skb_push(skb, dccp_hdr_reset_len);
544 dh = dccp_hdr(skb); 538 dh = dccp_hdr(skb);
@@ -590,18 +584,17 @@ static void dccp_v6_ctl_send_ack(struct sk_buff *rxskb)
590{ 584{
591 struct flowi fl; 585 struct flowi fl;
592 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; 586 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
593 const int dccp_hdr_ack_len = sizeof(struct dccp_hdr) + 587 const u32 dccp_hdr_ack_len = sizeof(struct dccp_hdr) +
594 sizeof(struct dccp_hdr_ext) + 588 sizeof(struct dccp_hdr_ext) +
595 sizeof(struct dccp_hdr_ack_bits); 589 sizeof(struct dccp_hdr_ack_bits);
596 struct sk_buff *skb; 590 struct sk_buff *skb;
597 591
598 skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + 592 skb = alloc_skb(dccp_v6_ctl_socket->sk->sk_prot->max_header,
599 dccp_hdr_ack_len, GFP_ATOMIC); 593 GFP_ATOMIC);
600 if (skb == NULL) 594 if (skb == NULL)
601 return; 595 return;
602 596
603 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) + 597 skb_reserve(skb, dccp_v6_ctl_socket->sk->sk_prot->max_header);
604 dccp_hdr_ack_len);
605 598
606 skb->h.raw = skb_push(skb, dccp_hdr_ack_len); 599 skb->h.raw = skb_push(skb, dccp_hdr_ack_len);
607 dh = dccp_hdr(skb); 600 dh = dccp_hdr(skb);