Blame SOURCES/open-iscsi-2.0.874-30-iscsiuio-fix-dhcpv6-transaction-id-mismatch-error.patch

36b27b
From: Chris Leech <cleech@redhat.com>
36b27b
Subject: iscsiuio: fix dhcpv6 transaction-id mismatch error
36b27b
36b27b
Bugzilla: ZZZ
36b27b
Upstream Status:
36b27b
Build Info: XXX
36b27b
Tested:
36b27b
36b27b
commit 5fd6428435f3063b4e980ead1fe0671856a20183
36b27b
Author: Nilesh Javali <nilesh.javali@cavium.com>
36b27b
Date:   Thu Feb 16 08:44:19 2017 -0500
36b27b
36b27b
    iscsiuio: fix dhcpv6 transaction-id mismatch error
36b27b
    
36b27b
    Initialize the transaction-id within the dhcpv6 packet with
36b27b
    correct byte order.
36b27b
    
36b27b
    Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
36b27b
---
36b27b
 iscsiuio/src/apps/dhcpc/dhcpv6.c | 9 +++++++--
36b27b
 1 file changed, 7 insertions(+), 2 deletions(-)
36b27b
36b27b
diff --git a/iscsiuio/src/apps/dhcpc/dhcpv6.c b/iscsiuio/src/apps/dhcpc/dhcpv6.c
36b27b
index a4e25f0bdbbd..461af0ec2a11 100644
36b27b
--- a/iscsiuio/src/apps/dhcpc/dhcpv6.c
36b27b
+++ b/iscsiuio/src/apps/dhcpc/dhcpv6.c
36b27b
@@ -153,7 +153,7 @@ static u16_t dhcpv6_init_packet(struct dhcpv6_context *context, u8_t type)
36b27b
 	if (dhcpv6->dhcpv6_type != type)
36b27b
 		context->dhcpv6_transaction_id++;
36b27b
 
36b27b
-	dhcpv6->dhcpv6_trans_id = context->dhcpv6_transaction_id;
36b27b
+	dhcpv6->dhcpv6_trans_id = HOST_TO_NET16(context->dhcpv6_transaction_id);
36b27b
 	dhcpv6->dhcpv6_type = type;
36b27b
 
36b27b
 	/* Keep track of length of all DHCP options. */
36b27b
@@ -265,8 +265,13 @@ void ipv6_udp_handle_dhcp(struct dhcpv6_context *context)
36b27b
 	dhcpv6 = (union dhcpv6_hdr *)((u8_t *)context->udp +
36b27b
 					sizeof(struct udp_hdr));
36b27b
 
36b27b
-	if (dhcpv6->dhcpv6_trans_id != context->dhcpv6_transaction_id)
36b27b
+	if (dhcpv6->dhcpv6_trans_id !=
36b27b
+	    HOST_TO_NET16(context->dhcpv6_transaction_id)) {
36b27b
+		LOG_ERR("DHCPv6 transaction-id error, sent %x, received %x",
36b27b
+			HOST_TO_NET16(context->dhcpv6_transaction_id),
36b27b
+			dhcpv6->dhcpv6_trans_id);
36b27b
 		return;
36b27b
+	}
36b27b
 
36b27b
 	dhcpv6_len =
36b27b
 	    NET_TO_HOST16(context->udp->length) - sizeof(struct udp_hdr);