Re: [PATCH] net: deliver skbs on inactive slaves to exact matches

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jay Vosburgh
Date: Thursday, May 6, 2010 - 11:01 am

John Fastabend <john.r.fastabend@intel.com> wrote:


	I was looking at this some yesterday and this morning, trying to
figure out if a packet going up the IP protocol stack with pkt_type ==
PACKET_DROP would break anything.  For example:

net/ipv4/ip_options.c:
int ip_options_rcv_srr(struct sk_buff *skb)
{
[...]
        if (!opt->srr)
                return 0;

        if (skb->pkt_type != PACKET_HOST)
                return -EINVAL;

	or:

net/ipv4/tcp_ipv4.c:
int tcp_v4_rcv(struct sk_buff *skb)
{
        const struct iphdr *iph;
        struct tcphdr *th;
        struct sock *sk;
        int ret;
        struct net *net = dev_net(skb->dev);

        if (skb->pkt_type != PACKET_HOST)
                goto discard_it;

	Is pkt_type == PACKET_DROP instead going to break things for
these, or the other similar cases?

	I think what you're looking for is really the usual PACKET_HOST,
PACKET_OTHERHOST, et al, upper protocol behavior, with the exception
that at the __netif_receive_skb level, wildcard matches in the ptypes
are not done.  Setting the pkt_type to PACKET_DROP loses the _HOST,
_OTHERHOST, etc, information, but sends the packet up the stack anyway,
and I'm not sure that's really the right thing to do.

	-J


---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] net: deliver skbs on inactive slaves to exact ..., Jay Vosburgh, (Thu May 6, 11:01 am)