IB/core: Fix and clean up ib_ud_header_init()

ib_ud_header_init() first clears header and then fills up the various
fields.  Later on, it tests header->immediate_present, which it has
already cleared, so the condition is always false.  Fix this by adding
an immediate_present parameter and setting header->immediate_present
as is done with grh_present.  Also remove unused calculation of
header_len.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
Eli Cohen
2010-02-08 11:40:37 +00:00
committed by Roland Dreier
parent ccbe9f0b11
commit 920d706c89
4 changed files with 7 additions and 12 deletions

View File

@@ -232,6 +232,7 @@ void ib_unpack(const struct ib_field *desc,
void ib_ud_header_init(int payload_bytes,
int grh_present,
int immediate_present,
struct ib_ud_header *header);
int ib_ud_header_pack(struct ib_ud_header *header,