netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <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
Date: Wed, 08 Feb 2017 10:23:40 -0500 (EST)	[thread overview]
Message-ID: <20170208.102340.236303502527636848.davem@davemloft.net> (raw)
In-Reply-To: <87inolropl.fsf@miraculix.mork.no>

From: Bjørn Mork <bjorn@mork.no>
Date: Wed, 08 Feb 2017 10:55:50 +0100

> Stefan Brüns <stefan.bruens@rwth-aachen.de> 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.

  reply	other threads:[~2017-02-08 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170208014633.15438-1-stefan.bruens@rwth-aachen.de>
     [not found] ` <20170208014633.15438-1-stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>
2017-02-08  1:46   ` [PATCH v3 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications Stefan Brüns
2017-02-08  9:55     ` Bjørn Mork
2017-02-08 15:23       ` David Miller [this message]
2017-02-08  1:46   ` [PATCH v3 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs Stefan Brüns

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170208.102340.236303502527636848.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bjorn@mork.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stefan.bruens@rwth-aachen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).