All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6
Date: Sat, 7 May 2016 11:30:25 +0300	[thread overview]
Message-ID: <20160507113025.67c3ab43@halley> (raw)
In-Reply-To: <1462585781-9146-2-git-send-email-dsa@cumulusnetworks.com>

Hi David,

On Fri,  6 May 2016 18:49:40 -0700 David Ahern <dsa@cumulusnetworks.com> wrote:
> +static bool ipv6_ndisc_frame(const struct sk_buff *skb)
> +{
> +	const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data;
> +	size_t hlen = sizeof(*ipv6h);
> +	bool rc = false;
> +
> +	if (ipv6h->nexthdr == NEXTHDR_ICMP) {
> +		const struct icmp6hdr *icmph;
> +
> +		if (skb->len < hlen + sizeof(*icmph))
> +			goto out;
> +
> +		icmph = (struct icmp6hdr *)(skb->data + sizeof(*ipv6h));
> +		switch (icmph->icmp6_type) {

Don't we need an additional pskb_may_pull here?

If I get it right, 'ipv6_rcv' only assures sizeof(ipv6hdr) to be in the
linear header (unless it's a NEXTHDR_HOP, which is not the case here).

> +static inline
> +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)
> +{
> +	struct net_device *master = NULL;
> +
> +	if (netif_is_l3_slave(skb->dev))
> +		master = netdev_master_upper_dev_get_rcu(skb->dev);
> +
> +	else if (netif_is_l3_master(skb->dev))
> +		master = skb->dev;
> +
> +	if (master && master->l3mdev_ops->l3mdev_l3_rcv)
> +		skb = master->l3mdev_ops->l3mdev_l3_rcv(master, skb, proto);

In the case where netif_is_l3_master(skb->dev) is true, can you explain
why we need to pass it through the l3mdev_l3_rcv callback again?

Regards,
Shmulik

  reply	other threads:[~2016-05-07  8:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07  1:49 [PATCH net-next v2 0/2] net: vrf: Fixup PKTINFO to return enslaved device index David Ahern
2016-05-07  1:49 ` [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6 David Ahern
2016-05-07  8:30   ` Shmulik Ladkani [this message]
2016-05-07 14:50     ` David Ahern
2016-05-07 18:32       ` Shmulik Ladkani
2016-05-08  2:25         ` David Ahern
2016-05-08  5:44           ` Shmulik Ladkani
2016-05-07  1:49 ` [PATCH net-next 2/2] net: original ingress device index in PKTINFO David Ahern
2016-05-07  8:41   ` Shmulik Ladkani
2016-05-07 14:53     ` David Ahern
2016-05-07 19:08       ` Shmulik Ladkani

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=20160507113025.67c3ab43@halley \
    --to=shmulik.ladkani@gmail.com \
    --cc=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.