Subject: Re: [PATCH] ipvlan: fix up broadcast MAC filtering for ARP and DHCP

From: Dan Williams <[email-masked]>
Date: Thu, 02 Apr 2015 13:46:35 -0500

On Thu, 2015-04-02 at 13:39 -0500, Dan Williams wrote:
> On Thu, 2015-04-02 at 14:16 -0400, David Miller wrote:
> > From: Dan Williams <[email-masked]>
> > 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.
> 
> I'm sorry about that, and I will fix style/indent and re-post once
> Mahesh and I have agreed on the exact behavior here.

It also conflicts with Jiri Benc's patches that you applied, so I need
to fix that up too.

Dan