Re: [PATCH bluetooth-next 2/2] 6lowpan: iphc: remove handling when dam is zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 17/11/15 19:54, Alexander Aring wrote:
This patch removes handling of LOWPAN_IPHC_DAM_00 inside the
lowpan_compress_addr_64 function. The case of LOWPAN_IPHC_DAM_00 can
never occur. there exists a if branch which use LOWPAN_IPHC_DAM_11 and
LOWPAN_IPHC_DAM_10 and inside the else branch LOWPAN_IPHC_DAM_01. So
LOWPAN_IPHC_DAM_00 can never occur.

Agreed the DAM_00 case means no compressions and carry the 128 bit address in line. We never call lowpan_compress_addr_64() for this case so removing this case which is never used is fine.
Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
---
  net/6lowpan/iphc.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 13f5424..f7f175c 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -594,7 +594,6 @@ int lowpan_header_decompress(struct sk_buff *skb, const struct net_device *dev,
  EXPORT_SYMBOL_GPL(lowpan_header_decompress);
static const u8 lowpan_iphc_dam_to_sam_value[] = {
-	[LOWPAN_IPHC_DAM_00] = LOWPAN_IPHC_SAM_00,
  	[LOWPAN_IPHC_DAM_01] = LOWPAN_IPHC_SAM_01,
  	[LOWPAN_IPHC_DAM_10] = LOWPAN_IPHC_SAM_10,
  	[LOWPAN_IPHC_DAM_11] = LOWPAN_IPHC_SAM_11,
@@ -603,7 +602,7 @@ static const u8 lowpan_iphc_dam_to_sam_value[] = {
  static u8 lowpan_compress_addr_64(u8 **hc_ptr, const struct in6_addr *ipaddr,
  				  const unsigned char *lladdr, bool sam)
  {
-	u8 dam = LOWPAN_IPHC_DAM_00;
+	u8 dam;
if (is_addr_mac_addr_based(ipaddr, lladdr)) {
  		dam = LOWPAN_IPHC_DAM_11; /* 0-bits */

Reviewed-by: Stefan Schmidt <stefan@xxxxxxxxxxxxxxx>

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux