All of lore.kernel.org
 help / color / mirror / Atom feed
* Pointer type of _arp in __skb_flow_dissect()
@ 2017-03-31 18:53 Nicolas Iooss
  2017-04-03  8:47 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2017-03-31 18:53 UTC (permalink / raw)
  To: David S. Miller, Simon Horman, netdev; +Cc: linux-kernel

Hello,

Linux 4.11-rc4 contains the following code in function
__skb_flow_dissect(), file net/core/flow_dissector.c:

	const struct arphdr *arp;
	struct arphdr *_arp;

	arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data,
				   hlen, &_arp);


Here _arp and arp are both pointers to arphdr structures. In other calls
to __skb_header_pointer(), the buffer argument (_arp here) would have
been a struct instead of a pointer. What makes ARP packets different in
__skb_flow_dissect()?

Thanks,
Nicolas

PS: the code which I am curious about seems to have been introduced in
4.11-rc1 with commit 55733350e5e8 ("flow disector: ARP support")

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Pointer type of _arp in __skb_flow_dissect()
  2017-03-31 18:53 Pointer type of _arp in __skb_flow_dissect() Nicolas Iooss
@ 2017-04-03  8:47 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2017-04-03  8:47 UTC (permalink / raw)
  To: Nicolas Iooss; +Cc: David S. Miller, netdev, linux-kernel

Hi Nicolas,

thanks for pointing this out.

On Fri, Mar 31, 2017 at 08:53:10PM +0200, Nicolas Iooss wrote:
> Hello,
> 
> Linux 4.11-rc4 contains the following code in function
> __skb_flow_dissect(), file net/core/flow_dissector.c:
> 
> 	const struct arphdr *arp;
> 	struct arphdr *_arp;

It looks like *_arp should be _arp.
And it looks like this affects net, since v4.11-rc1, and net-next.
I'll test the fix and post a patch unless someone beats me to it.

> 
> 	arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data,
> 				   hlen, &_arp);
> 
> 
> Here _arp and arp are both pointers to arphdr structures. In other calls
> to __skb_header_pointer(), the buffer argument (_arp here) would have
> been a struct instead of a pointer. What makes ARP packets different in
> __skb_flow_dissect()?
> 
> Thanks,
> Nicolas
> 
> PS: the code which I am curious about seems to have been introduced in
> 4.11-rc1 with commit 55733350e5e8 ("flow disector: ARP support")

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-03  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 18:53 Pointer type of _arp in __skb_flow_dissect() Nicolas Iooss
2017-04-03  8:47 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.