<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter/ipvs, branch v5.12</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-02-06T23:34:23Z</updated>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next</title>
<updated>2021-02-06T23:34:23Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2021-02-06T23:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c273a20c304f299d4cf24ba0c9c9f54b7d580b77'/>
<id>urn:sha1:c273a20c304f299d4cf24ba0c9c9f54b7d580b77</id>
<content type='text'>
Pablo Neira Ayuso says:

====================
Netfilter/IPVS updates for net-next

1) Remove indirection and use nf_ct_get() instead from nfnetlink_log
   and nfnetlink_queue, from Florian Westphal.

2) Add weighted random twos choice least-connection scheduling for IPVS,
   from Darby Payne.

3) Add a __hash placeholder in the flow tuple structure to identify
   the field to be included in the rhashtable key hash calculation.

4) Add a new nft_parse_register_load() and nft_parse_register_store()
   to consolidate register load and store in the core.

5) Statify nft_parse_register() since it has no more module clients.

6) Remove redundant assignment in nft_cmp, from Colin Ian King.

* git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next:
  netfilter: nftables: remove redundant assignment of variable err
  netfilter: nftables: statify nft_parse_register()
  netfilter: nftables: add nft_parse_register_store() and use it
  netfilter: nftables: add nft_parse_register_load() and use it
  netfilter: flowtable: add hash offset field to tuple
  ipvs: add weighted random twos choice algorithm
  netfilter: ctnetlink: remove get_ct indirection
====================

Link: https://lore.kernel.org/r/20210206015005.23037-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: move handlers to net/ip_vs.h</title>
<updated>2021-02-05T02:37:57Z</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2021-02-03T13:51:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=edf597da02a01edb26bddf06890fb81eee3d82cf'/>
<id>urn:sha1:edf597da02a01edb26bddf06890fb81eee3d82cf</id>
<content type='text'>
Fix the following compilation warnings:
net/netfilter/ipvs/ip_vs_proto_tcp.c:147:1: warning: no previous prototype for 'tcp_snat_handler' [-Wmissing-prototypes]
  147 | tcp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp,
      | ^~~~~~~~~~~~~~~~
net/netfilter/ipvs/ip_vs_proto_udp.c:136:1: warning: no previous prototype for 'udp_snat_handler' [-Wmissing-prototypes]
  136 | udp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp,
      | ^~~~~~~~~~~~~~~~

Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: remove redundant 'depends on NET'</title>
<updated>2021-01-28T01:04:12Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-01-25T23:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=864e898ba3f6a7974d35efb604a1345d50e45f91'/>
<id>urn:sha1:864e898ba3f6a7974d35efb604a1345d50e45f91</id>
<content type='text'>
These Kconfig files are included from net/Kconfig, inside the
if NET ... endif.

Remove 'depends on NET', which we know it is already met.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Link: https://lore.kernel.org/r/20210125232026.106855-1-masahiroy@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipvs: add weighted random twos choice algorithm</title>
<updated>2021-01-26T00:09:46Z</updated>
<author>
<name>Darby Payne</name>
<email>darby.payne@gmail.com</email>
</author>
<published>2021-01-06T19:02:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=012da53d1afb619556f1a63c9da76b15888b190f'/>
<id>urn:sha1:012da53d1afb619556f1a63c9da76b15888b190f</id>
<content type='text'>
Adds the random twos choice load-balancing algorithm. The algorithm will
pick two random servers based on weights. Then select the server with
the least amount of connections normalized by weight. The algorithm
avoids the "herd behavior" problem. The algorithm comes from a paper
by Michael Mitzenmacher available here
http://www.eecs.harvard.edu/~michaelm/NEWWORK/postscripts/twosurvey.pdf

Signed-off-by: Darby Payne &lt;darby.payne@gmail.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Acked-by: Simon Horman &lt;horms@verge.net.au&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next</title>
<updated>2020-12-14T23:43:21Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2020-12-14T23:43:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7bca5021a4e653a323492cb500cfc387331481b9'/>
<id>urn:sha1:7bca5021a4e653a323492cb500cfc387331481b9</id>
<content type='text'>
Pablo Neira Ayuso says:

====================
Netfilter/IPVS updates for net-next

1) Missing dependencies in NFT_BRIDGE_REJECT, from Randy Dunlap.

2) Use atomic_inc_return() instead of atomic_add_return() in IPVS,
   from Yejune Deng.

3) Simplify check for overquota in xt_nfacct, from Kaixu Xia.

4) Move nfnl_acct_list away from struct net, from Miao Wang.

5) Pass actual sk in reject actions, from Jan Engelhardt.

6) Add timeout and protoinfo to ctnetlink destroy events,
   from Florian Westphal.

7) Four patches to generalize set infrastructure to support
   for multiple expressions per set element.

* git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next:
  netfilter: nftables: netlink support for several set element expressions
  netfilter: nftables: generalize set extension to support for several expressions
  netfilter: nftables: move nft_expr before nft_set
  netfilter: nftables: generalize set expressions support
  netfilter: ctnetlink: add timeout and protoinfo to destroy events
  netfilter: use actual socket sk for REJECT action
  netfilter: nfnl_acct: remove data from struct net
  netfilter: Remove unnecessary conversion to bool
  ipvs: replace atomic_add_return()
  netfilter: nft_reject_bridge: fix build errors due to code movement
====================

Link: https://lore.kernel.org/r/20201212230513.3465-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipvs: fix possible memory leak in ip_vs_control_net_init</title>
<updated>2020-11-27T11:10:46Z</updated>
<author>
<name>Wang Hai</name>
<email>wanghai38@huawei.com</email>
</author>
<published>2020-11-24T08:07:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4bc3c8dc9f5f1eff0d3bfa59491383ac11308b6b'/>
<id>urn:sha1:4bc3c8dc9f5f1eff0d3bfa59491383ac11308b6b</id>
<content type='text'>
kmemleak report a memory leak as follows:

BUG: memory leak
unreferenced object 0xffff8880759ea000 (size 256):
backtrace:
[&lt;00000000c0bf2deb&gt;] kmem_cache_zalloc include/linux/slab.h:656 [inline]
[&lt;00000000c0bf2deb&gt;] __proc_create+0x23d/0x7d0 fs/proc/generic.c:421
[&lt;000000009d718d02&gt;] proc_create_reg+0x8e/0x140 fs/proc/generic.c:535
[&lt;0000000097bbfc4f&gt;] proc_create_net_data+0x8c/0x1b0 fs/proc/proc_net.c:126
[&lt;00000000652480fc&gt;] ip_vs_control_net_init+0x308/0x13a0 net/netfilter/ipvs/ip_vs_ctl.c:4169
[&lt;000000004c927ebe&gt;] __ip_vs_init+0x211/0x400 net/netfilter/ipvs/ip_vs_core.c:2429
[&lt;00000000aa6b72d9&gt;] ops_init+0xa8/0x3c0 net/core/net_namespace.c:151
[&lt;00000000153fd114&gt;] setup_net+0x2de/0x7e0 net/core/net_namespace.c:341
[&lt;00000000be4e4f07&gt;] copy_net_ns+0x27d/0x530 net/core/net_namespace.c:482
[&lt;00000000f1c23ec9&gt;] create_new_namespaces+0x382/0xa30 kernel/nsproxy.c:110
[&lt;00000000098a5757&gt;] copy_namespaces+0x2e6/0x3b0 kernel/nsproxy.c:179
[&lt;0000000026ce39e9&gt;] copy_process+0x220a/0x5f00 kernel/fork.c:2072
[&lt;00000000b71f4efe&gt;] _do_fork+0xc7/0xda0 kernel/fork.c:2428
[&lt;000000002974ee96&gt;] __do_sys_clone3+0x18a/0x280 kernel/fork.c:2703
[&lt;0000000062ac0a4d&gt;] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
[&lt;0000000093f1ce2c&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xa9

In the error path of ip_vs_control_net_init(), remove_proc_entry() needs
to be called to remove the added proc entry, otherwise a memory leak
will occur.

Also, add some '#ifdef CONFIG_PROC_FS' because proc_create_net* return NULL
when PROC is not used.

Fixes: b17fc9963f83 ("IPVS: netns, ip_vs_stats and its procfs")
Fixes: 61b1ab4583e2 ("IPVS: netns, add basic init per netns.")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>ipvs: replace atomic_add_return()</title>
<updated>2020-11-22T12:45:52Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2020-11-16T08:01:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=988187e8810364dc02f3ceb7cab497f4a2e9003f'/>
<id>urn:sha1:988187e8810364dc02f3ceb7cab497f4a2e9003f</id>
<content type='text'>
atomic_inc_return() looks better

Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: use actual socket sk rather than skb sk when routing harder</title>
<updated>2020-10-30T11:57:39Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2020-10-29T02:56:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46d6c5ae953cc0be38efd0e469284df7c4328cf8'/>
<id>urn:sha1:46d6c5ae953cc0be38efd0e469284df7c4328cf8</id>
<content type='text'>
If netfilter changes the packet mark when mangling, the packet is
rerouted using the route_me_harder set of functions. Prior to this
commit, there's one big difference between route_me_harder and the
ordinary initial routing functions, described in the comment above
__ip_queue_xmit():

   /* Note: skb-&gt;sk can be different from sk, in case of tunnels */
   int __ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,

That function goes on to correctly make use of sk-&gt;sk_bound_dev_if,
rather than skb-&gt;sk-&gt;sk_bound_dev_if. And indeed the comment is true: a
tunnel will receive a packet in ndo_start_xmit with an initial skb-&gt;sk.
It will make some transformations to that packet, and then it will send
the encapsulated packet out of a *new* socket. That new socket will
basically always have a different sk_bound_dev_if (otherwise there'd be
a routing loop). So for the purposes of routing the encapsulated packet,
the routing information as it pertains to the socket should come from
that socket's sk, rather than the packet's original skb-&gt;sk. For that
reason __ip_queue_xmit() and related functions all do the right thing.

One might argue that all tunnels should just call skb_orphan(skb) before
transmitting the encapsulated packet into the new socket. But tunnels do
*not* do this -- and this is wisely avoided in skb_scrub_packet() too --
because features like TSQ rely on skb-&gt;destructor() being called when
that buffer space is truely available again. Calling skb_orphan(skb) too
early would result in buffers filling up unnecessarily and accounting
info being all wrong. Instead, additional routing must take into account
the new sk, just as __ip_queue_xmit() notes.

So, this commit addresses the problem by fishing the correct sk out of
state-&gt;sk -- it's already set properly in the call to nf_hook() in
__ip_local_out(), which receives the sk as part of its normal
functionality. So we make sure to plumb state-&gt;sk through the various
route_me_harder functions, and then make correct use of it following the
example of __ip_queue_xmit().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reviewed-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>ipvs: adjust the debug info in function set_tcp_state</title>
<updated>2020-10-20T11:54:46Z</updated>
<author>
<name>longguang.yue</name>
<email>bigclouds@163.com</email>
</author>
<published>2020-09-28T02:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79dce09ab02729a90cf6ce49c9aaaf17aa0d21db'/>
<id>urn:sha1:79dce09ab02729a90cf6ce49c9aaaf17aa0d21db</id>
<content type='text'>
Outputting client,virtual,dst addresses info when tcp state changes,
which makes the connection debug more clear

Signed-off-by: longguang.yue &lt;bigclouds@163.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2020-10-15T19:43:21Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2020-10-15T19:43:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2295cddf99e3f7c2be2b1160e2f5e53cc35b09be'/>
<id>urn:sha1:2295cddf99e3f7c2be2b1160e2f5e53cc35b09be</id>
<content type='text'>
Minor conflicts in net/mptcp/protocol.h and
tools/testing/selftests/net/Makefile.

In both cases code was added on both sides in the same place
so just keep both.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
