lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALnjE+psnT7X6GmkPfartSsVC1CVJOfdHy6-B8mnE+H4Tu2HiA@mail.gmail.com>
Date:	Fri, 14 Jun 2013 19:17:07 -0700
From:	Pravin Shelar <pshelar@...ira.com>
To:	Jesse Gross <jesse@...ira.com>
Cc:	netdev <netdev@...r.kernel.org>,
	"dev@...nvswitch.org" <dev@...nvswitch.org>
Subject: Re: [ovs-dev] [PATCH net-next 06/12] ip_tunnel: push generic protocol
 handling to ip_tunnel module.

On Fri, Jun 14, 2013 at 5:20 PM, Jesse Gross <jesse@...ira.com> wrote:
> On Thu, Jun 13, 2013 at 11:24 AM, Pravin B Shelar <pshelar@...ira.com> wrote:
>>  static int gre_cisco_rcv(struct sk_buff *skb)
>> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
>> index b7b8d15..c41faf8 100644
>> --- a/net/ipv4/ip_tunnel.c
>> +++ b/net/ipv4/ip_tunnel.c
>> @@ -442,23 +435,6 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
>>                 tunnel->i_seqno = ntohl(tpi->seq) + 1;
>>         }
>>
>> -       /* Warning: All skb pointers will be invalidated! */
>> -       if (tunnel->dev->type == ARPHRD_ETHER) {
>> -               if (!pskb_may_pull(skb, ETH_HLEN)) {
>> -                       tunnel->dev->stats.rx_length_errors++;
>> -                       tunnel->dev->stats.rx_errors++;
>> -                       goto drop;
>> -               }
>> -
>> -               iph = ip_hdr(skb);
>> -               skb->protocol = eth_type_trans(skb, tunnel->dev);
>> -               skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
>> -       }
>> -
>> -       skb->pkt_type = PACKET_HOST;
>> -       __skb_tunnel_rx(skb, tunnel->dev);
>> -
>> -       skb_reset_network_header(skb);
>>         err = IP_ECN_decapsulate(iph, skb);
>>         if (unlikely(err)) {
>>                 if (log_ecn_error)
>> @@ -477,6 +453,12 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
>>         tstats->rx_bytes += skb->len;
>>         u64_stats_update_end(&tstats->syncp);
>>
>> +       if (tunnel->dev->type == ARPHRD_ETHER) {
>> +               skb->protocol = eth_type_trans(skb, tunnel->dev);
>> +               skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
>> +       } else {
>> +               skb->dev = tunnel->dev;
>> +       }
>
> Why don't we set the tunnel device in the case of an L2 packet? This
> appears related to the removal of __skb_tunnel_rx() but it seems there
> is now less consistency between L2 and L3 tunnels.

device is set in eth_type_trans() for L2.

--Pravin.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ