[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150402.141623.717255772856055027.davem@davemloft.net>
Date: Thu, 02 Apr 2015 14:16:23 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: dcbw@...hat.com
Cc: maheshb@...gle.com, netdev@...r.kernel.org, jbenc@...hat.com
Subject: Re: [PATCH] ipvlan: fix up broadcast MAC filtering for ARP and DHCP
From: Dan Williams <dcbw@...hat.com>
Date: Mon, 30 Mar 2015 23:22:50 -0500
> + case htons(ETH_P_ALL): {
> + /* Raw sockets */
> + if (eth_hdr(skb)->h_proto != htons(ETH_P_IP))
> + break;
> + /* Fall through */
> + }
You are not declaring any local variables in this switch block, therefore
there is no reason to surround it with curly braces, remove them.
> + if (skb->len < DHCP_PACKET_MIN_LEN || ip4h->protocol != IPPROTO_UDP
> + || ip_is_fragment(ip4h))
> + return false;
This is not formatted properly.
Lines of conditional statements _END_ with operators, they should never
begin with one.
Also, the second and subsequent lines of a multi-line if() statement should
begin precisely at the first column after the openning parenthesis of the
first line. You must use the appropriate number of TAB then SPACE characters
to achieve this.
If you are purely using TAB characters to indent these things, it is almost
certain that you are doing it wrong.
And yes, I am super sick of typing this in several times a day, especially
when this is not only documented, but checked for by checkpatch and other
automated tools.
> + lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
> + if (!ipvlan->dhcp4_seen && lyr3h && addr_type == IPVL_IPV4
> + && is_dhcp(skb)) {
Likewise.
--
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