From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932386AbdBHPb1 convert rfc822-to-8bit (ORCPT ); Wed, 8 Feb 2017 10:31:27 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:52440 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbdBHPbW (ORCPT ); Wed, 8 Feb 2017 10:31:22 -0500 Date: Wed, 08 Feb 2017 10:23:40 -0500 (EST) Message-Id: <20170208.102340.236303502527636848.davem@davemloft.net> To: bjorn@mork.no Cc: stefan.bruens@rwth-aachen.de, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications From: David Miller In-Reply-To: <87inolropl.fsf@miraculix.mork.no> References: <20170208014633.15438-1-stefan.bruens@rwth-aachen.de> <916d0ee7460a4fcfaa1a951cf39e8607@rwthex-w2-b.rwth-ad.de> <87inolropl.fsf@miraculix.mork.no> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 08 Feb 2017 06:24:44 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjørn Mork Date: Wed, 08 Feb 2017 10:55:50 +0100 > Stefan Brüns writes: > >> If a context is configured as dualstack ("IPv4v6"), the modem indicates >> the context activation with a slightly different indication message. >> The dual-stack indication omits the link_type (IPv4/v6) and adds >> additional address fields. > > Great! > >> IPv6 LSIs are identical to IPv4 LSIs, but have a different link type. >> +struct lsi_umts_dual { >> + struct lsi_umts lsi; >> + u8 pdp_addr4_len; /* NW-supplied PDP IPv4 address len */ >> + u8 pdp_addr4[4]; /* NW-supplied PDP IPv4 address (bigendian)) */ >> + u8 pdp_addr6_len; /* NW-supplied PDP IPv6 address len */ >> + u8 pdp_addr6[16]; /* NW-supplied PDP IPv6 address (bigendian)) */ > > > Maybe use "struct in_addr" and "struct in6_addr" for all the address > fields, making them a bit more accessible and avoiding having to define > endianness explicitly? Can't do that, it will add padding to the structure and not match what is really in the header. The problem is that we get a "u8" length first which starts the address on an odd byte. And we don't want to use "__packed" to fix this either.