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+ogr7PYnEMtAyMmZUzLhTtAdqS3FBOQ1BCvkhjEvCgHqQ@mail.gmail.com>
Date:	Wed, 31 Jul 2013 20:01:04 -0700
From:	Pravin Shelar <pshelar@...ira.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next v5 2/7] vxlan: Restructure vxlan receive for
 multiple protocols.

On Wed, Jul 31, 2013 at 4:47 PM, Stephen Hemminger
<stephen@...workplumber.org> wrote:
> On Wed, 31 Jul 2013 16:14:29 -0700
> Pravin B Shelar <pshelar@...ira.com> wrote:
>
>> -- a/drivers/net/vxlan.c
>> +++ b/drivers/net/vxlan.c
>> @@ -57,6 +57,7 @@
>>  #define VXLAN_VID_MASK       (VXLAN_N_VID - 1)
>>  /* IP header + UDP + VXLAN + Ethernet header */
>>  #define VXLAN_HEADROOM (20 + 8 + 8 + 14)
>> +#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr))
>>
>>  #define VXLAN_FLAGS 0x08000000       /* struct vxlanhdr.vx_flags required value. */
>>
>> @@ -82,8 +83,12 @@ static int vxlan_net_id;
>>
>>  static const u8 all_zeros_mac[ETH_ALEN];
>>
>> +struct vxlan_sock;
>> +typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key);
>> +
>>  /* per UDP socket information */
>>  struct vxlan_sock {
>> +     vxlan_rcv_t      *rcv;
>>       struct hlist_node hlist;
>>       struct rcu_head   rcu;
>>       struct work_struct del_work;
>> @@ -211,6 +216,18 @@ static struct vxlan_dev *vxlan_find_vni(struct net *net, u32 id, __be16 port)
>>       return NULL;
>>  }
>>
>> +static struct vxlan_dev *vxlan_find_vni_port(struct vxlan_sock *vs, u32 id)
>> +{
>> +     struct vxlan_dev *vxlan;
>> +
>> +     hlist_for_each_entry_rcu(vxlan, vni_head(vs, id), hlist) {
>> +             if (vxlan->default_dst.remote_vni == id)
>> +                     return vxlan;
>> +     }
>> +
>> +     return NULL;
>> +}
>> +
>>  /* Fill in neighbour message in skbuff. */
>>  static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
>>                         const struct vxlan_fdb *fdb,
>> @@ -836,23 +853,16 @@ static void vxlan_igmp_work(struct work_struct *work)
>>  /* Callback from net/ipv4/udp.c to receive packets */
>>  static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
>>  {
>> -     struct iphdr *oip;
>> +     struct vxlan_sock *vs;
>>       struct vxlanhdr *vxh;
>> -     struct vxlan_dev *vxlan;
>> -     struct pcpu_tstats *stats;
>>       __be16 port;
>> -     __u32 vni;
>> -     int err;
>> -
>> -     /* pop off outer UDP header */
>> -     __skb_pull(skb, sizeof(struct udphdr));
>>
>>       /* Need Vxlan and inner Ethernet header to be present */
>> -     if (!pskb_may_pull(skb, sizeof(struct vxlanhdr)))
>> +     if (!pskb_may_pull(skb, VXLAN_HLEN))
>>               goto error;
>
> This patch would be clearer if split into two parts.
> One for the parsing changes (like VXLAN_HLEN) and other for the receive
> callback.

ok, I will send updated patch.
--
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