From patchwork Tue Aug 2 14:37:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 9257775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 308FC60754 for ; Tue, 2 Aug 2016 14:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2316428610 for ; Tue, 2 Aug 2016 14:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17A5D28617; Tue, 2 Aug 2016 14:40:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E641C28610 for ; Tue, 2 Aug 2016 14:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756681AbcHBOjV (ORCPT ); Tue, 2 Aug 2016 10:39:21 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:42959 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756859AbcHBOix (ORCPT ); Tue, 2 Aug 2016 10:38:53 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=omega.localdomain) by metis.ext.pengutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1bUapp-0005Mi-0L; Tue, 02 Aug 2016 16:38:21 +0200 From: Alexander Aring To: linux-wpan@vger.kernel.org Cc: kernel@pengutronix.de, linux-bluetooth@vger.kernel.org, Alexander Aring Subject: [PATCH linux-wpan/radvd for-upstream 1/2] device-linux: replace ARPHRD_IEEE802154 to ARPHRD_6LOWPAN Date: Tue, 2 Aug 2016 16:37:51 +0200 Message-Id: <20160802143752.12831-2-aar@pengutronix.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160802143752.12831-1-aar@pengutronix.de> References: <20160802143752.12831-1-aar@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: aar@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wpan@vger.kernel.org Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch changes the ARPHRD_IEEE802154 to ARPHRD_6LOWPAN. The IEEE 802.15.4 6lowpan module changed the ARPHRD_IEEE802154 type to ARPHRD_6LOWPAN. Nowadays it's use ARPHRD_6LOWPAN which is also used by BTLE 6LoWPAN. Both interfaces uses an EUI64 address and the handling to get the link-layer address should be the same. There is no backward compatibility for 802.15.4 6LoWPAN before we changed the ARPHRD. Anyway if somebody wants that it should be patched manually. When the ARPHRD was ARPHRD_IEEE802154 the 802.15.4 6lowpan was anyway in a somehow unusable state. Signed-off-by: Alexander Aring --- device-linux.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/device-linux.c b/device-linux.c index de83f2e..7301927 100644 --- a/device-linux.c +++ b/device-linux.c @@ -22,6 +22,10 @@ #define IPV6_ADDR_LINKLOCAL 0x0020U #endif +#ifndef ARPHRD_6LOWPAN +#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ +#endif + static char const *hwstr(unsigned short sa_family); /* @@ -79,12 +83,10 @@ int update_device_info(int sock, struct Interface *iface) iface->sllao.if_maxmtu = -1; break; #endif /* ARPHDR_ARCNET */ -#ifdef ARPHRD_IEEE802154 - case ARPHRD_IEEE802154: + case ARPHRD_6LOWPAN: iface->sllao.if_hwaddr_len = 64; iface->sllao.if_prefix_len = 64; break; -#endif default: iface->sllao.if_hwaddr_len = -1; iface->sllao.if_prefix_len = -1; @@ -382,6 +384,9 @@ static char const *hwstr(unsigned short sa_family) rc = "ARPHRD_IEEE802154_PHY"; break; #endif + case ARPHRD_6LOWPAN: + rc = "ARPHRD_6LOWPAN"; + break; case ARPHRD_VOID: rc = "ARPHRD_VOID"; break;