Re: [PATCH v2 net-next] udp_diag: fix udp_dump_one() vs SO_REUSEPORT

2016-01-05 Thread Eric Dumazet
On Tue, 2016-01-05 at 17:56 -0500, Craig Gallek wrote: > On Tue, Jan 5, 2016 at 5:33 PM, Eric Dumazet wrote: > > From: Eric Dumazet > > + unsigned short hnum = ntohs(req->id.idiag_dport); > > + unsigned int slot = udp_hashfn(net, hnum, tbl->mask); > > + struct udp_hslot *hslot =

Re: [PATCH v2 net-next] udp_diag: fix udp_dump_one() vs SO_REUSEPORT

2016-01-05 Thread Craig Gallek
On Tue, Jan 5, 2016 at 5:33 PM, Eric Dumazet wrote: > From: Eric Dumazet > + unsigned short hnum = ntohs(req->id.idiag_dport); > + unsigned int slot = udp_hashfn(net, hnum, tbl->mask); > + struct udp_hslot *hslot = &tbl->hash[slot]; > + struct hlist_nulls_node *node; > +

[PATCH v2 net-next] udp_diag: fix udp_dump_one() vs SO_REUSEPORT

2016-01-05 Thread Eric Dumazet
From: Eric Dumazet udp_dump_one() uses __udp4_lib_lookup() & __udp6_lib_lookup() which cannot properly handle the provided cookie when SO_REUSEPORT is used, as many sockets share the same 4-tuple Instead, let's use the provided 64bit cookie to uniquely identify the socket. This will allow us to