From: Alexander Aring <alex.aring@gmail.com>
To: davem@davemloft.net
Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org,
dav.lebrun@gmail.com, mcr@sandelman.ca,
stefan@datenfreihafen.org, kai.beckmann@hs-rm.de,
martin.gergeleit@hs-rm.de, robert.kaiser@hs-rm.de,
netdev@vger.kernel.org
Subject: Re: [PACTH net-next 5/5] net: ipv6: add rpl sr tunnel
Date: Wed, 19 Feb 2020 09:45:10 -0500 [thread overview]
Message-ID: <20200219144510.2dqsxrbs26azzh6m@ryzen> (raw)
In-Reply-To: <20200217223541.18862-6-alex.aring@gmail.com>
Hi,
On Mon, Feb 17, 2020 at 05:35:41PM -0500, Alexander Aring wrote:
> This patch adds functionality to configure routes for RPL source routing
> functionality. There is no IPIP functionality yet implemented which can
> be added later when the cases when to use IPv6 encapuslation comes more
> clear.
>
...
> +
> +static bool rpl_validate_srh(struct net *net, struct ipv6_rpl_sr_hdr *srh,
> + size_t seglen)
> +{
> + int err;
> +
> + if ((srh->hdrlen << 3) != seglen)
> + return false;
> +
I added here a:
/* check at least one segment and seglen fit with segments_left */
if (!srh->segments_left ||
(srh->segments_left * sizeof(struct in6_addr)) != seglen)
return false;
which makes sense to do. No zero segments and check if seglen is the
same as 16 * segments, because we don't support to set compressed
segments yet and I don't know if we ever will.
> + if (srh->cmpri || srh->cmpre)
> + return false;
> +
> + err = ipv6_chk_rpl_srh_loop(net, srh->rpl_segaddr,
> + srh->segments_left);
> + if (err)
> + return false;
> +
> + if (ipv6_addr_type(&srh->rpl_segaddr[srh->segments_left - 1]) &
> + IPV6_ADDR_MULTICAST)
> + return false;
> +
> + return true;
> +}
> +
- Alex
prev parent reply other threads:[~2020-02-19 14:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 22:35 [PACTH net-next 0/5] net: ipv6: add rpl source routing Alexander Aring
2020-02-17 22:35 ` [PACTH net-next 1/5] include: uapi: linux: add rpl sr header definition Alexander Aring
2020-02-17 22:35 ` [PACTH net-next 2/5] addrconf: add functionality to check on rpl requirements Alexander Aring
2020-02-17 22:35 ` [PACTH net-next 3/5] net: ipv6: add support for rpl sr exthdr Alexander Aring
2020-02-17 22:35 ` [PACTH net-next 4/5] net: add net available in build_state Alexander Aring
2020-02-17 22:35 ` [PACTH net-next 5/5] net: ipv6: add rpl sr tunnel Alexander Aring
2020-02-18 5:47 ` David Miller
2020-02-19 14:41 ` Alexander Aring
2020-02-19 19:12 ` Jakub Kicinski
2020-02-20 23:02 ` David Miller
2020-02-19 14:45 ` Alexander Aring [this message]
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=20200219144510.2dqsxrbs26azzh6m@ryzen \
--to=alex.aring@gmail.com \
--cc=dav.lebrun@gmail.com \
--cc=davem@davemloft.net \
--cc=kai.beckmann@hs-rm.de \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=martin.gergeleit@hs-rm.de \
--cc=mcr@sandelman.ca \
--cc=netdev@vger.kernel.org \
--cc=robert.kaiser@hs-rm.de \
--cc=stefan@datenfreihafen.org \
--cc=yoshfuji@linux-ipv6.org \
/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