All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shan Wei <shanwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: [PATCH 1/3] sctp: use transport to guess overhead  value of packet
Date: Fri, 02 Jul 2010 08:17:04 +0000	[thread overview]
Message-ID: <4C2DA080.8050101@cn.fujitsu.com> (raw)


Although the assoc is null, we can use af_specific of transport
to point to header size of IPv4 or IPv6.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 net/sctp/output.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/output.c b/net/sctp/output.c
index a646681..48177d3 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -127,7 +127,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
 		struct sctp_sock *sp = sctp_sk(asoc->base.sk);
 		overhead = sp->pf->af->net_header_len;
 	} else {
-		overhead = sizeof(struct ipv6hdr);
+		overhead = transport->af_specific->net_header_len;
 	}
 	overhead += sizeof(struct sctphdr);
 	packet->overhead = overhead;
-- 
1.7.0

                 reply	other threads:[~2010-07-02  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2DA080.8050101@cn.fujitsu.com \
    --to=shanwei@cn.fujitsu.com \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.