diff options
author | tuexen <tuexen@FreeBSD.org> | 2011-02-07 15:04:23 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2011-02-07 15:04:23 +0000 |
commit | 9ccaf288c9178d6dbdbb001ffec81fa6f7139f57 (patch) | |
tree | 3793c883577d61272e38191fd7538afba95a6038 /sys/netinet6/sctp6_usrreq.c | |
parent | 8ea2135428216d0aa78aa73b0611a2b0afeb4aa5 (diff) | |
download | FreeBSD-src-9ccaf288c9178d6dbdbb001ffec81fa6f7139f57.zip FreeBSD-src-9ccaf288c9178d6dbdbb001ffec81fa6f7139f57.tar.gz |
Fix bugs related to M_FLOWID:
* Store the flowid when receiving an SCTP/IPv6 packet.
* Store the flowid when receiving an SCTP packet with wrong CRC.
* Initilize flowid correctly.
* Put test code under INVARIANTS.
MFC after: 3 months.
Diffstat (limited to 'sys/netinet6/sctp6_usrreq.c')
-rw-r--r-- | sys/netinet6/sctp6_usrreq.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index ecfcb63..fd71dec 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -170,6 +170,12 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto) } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { sctp_send_packet_dropped(stcb, net, m, iphlen, 1); @@ -198,6 +204,12 @@ sctp_skip_csum: } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased */ if (in6p == NULL) { struct sctp_init_chunk *init_chk, chunk_buf; |