linux/net
Florian Westphal 1ad8f48df6 netfilter: nftables: add connlabel set support
Conntrack labels are currently sized depending on the iptables
ruleset, i.e. if we're asked to test or set bits 1, 2, and 65 then we
would allocate enough room to store at least bit 65.

However, with nft, the input is just a register with arbitrary runtime
content.

We therefore ask for the upper ceiling we currently have, which is
enough room to store 128 bits.

Alternatively, we could alter nf_connlabel_replace to increase
net->ct.label_words at run time, but since 128 bits is not that
big we'd only save sizeof(long) so it doesn't seem worth it for now.

This follows a similar approach that xtables 'connlabel'
match uses, so when user inputs

    ct label set bar

then we will set the bit used by the 'bar' label and leave the rest alone.

This is done by passing the sreg content to nf_connlabels_replace
as both value and mask argument.
Labels (bits) already set thus cannot be re-set to zero, but
this is not supported by xtables connlabel match either.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-05-05 16:27:59 +02:00
..
6lowpan 6lowpan: iphc: fix handling of link-local compression 2016-04-08 19:28:13 +02:00
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth sock: tigthen lockdep checks for sock_owned_by_user 2016-04-13 22:37:20 -04:00
bridge Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
caif
can
ceph
core libnl: nla_put_msecs(): align on a 64-bit area 2016-04-23 20:13:24 -04:00
dcb
dccp net: introduce lockdep_is_held and update various places to use it 2016-04-07 16:44:14 -04:00
decnet decnet: Do not build routes to devices without decnet private data. 2016-04-10 23:01:30 -04:00
dns_resolver
dsa net: dsa: remove tag_protocol from dsa_switch 2016-04-21 13:43:11 -04:00
ethernet
hsr NLA_BINARY misuse bug in HSR 2016-04-21 13:59:08 -04:00
ieee802154 libnl: nla_put_le64(): align on a 64-bit area 2016-04-23 20:13:24 -04:00
ipv4 netfilter: fix IS_ERR_VALUE usage 2016-04-29 11:02:33 +02:00
ipv6 netfilter: fix IS_ERR_VALUE usage 2016-04-29 11:02:33 +02:00
ipx
irda
iucv
kcm
key
l2tp libnl: nla_put_msecs(): align on a 64-bit area 2016-04-23 20:13:24 -04:00
l3mdev
lapb
llc sock: tigthen lockdep checks for sock_owned_by_user 2016-04-13 22:37:20 -04:00
mac80211 cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
mac802154
mpls GSO: Add GSO type for fixed IPv4 ID 2016-04-14 16:23:40 -04:00
netfilter netfilter: nftables: add connlabel set support 2016-05-05 16:27:59 +02:00
netlabel
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
netrom
nfc
openvswitch Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2016-04-24 00:12:08 -04:00
packet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
phonet
rds RDS: Fix the atomicity for congestion map update 2016-04-16 19:01:05 -04:00
rfkill
rose
rxrpc rxrpc: Create a null security type and get rid of conditional calls 2016-04-11 15:34:41 -04:00
sched Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
sctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
sunrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
switchdev
tipc tipc: fix stale links after re-enabling bearer 2016-04-24 14:35:07 -04:00
unix
vmw_vsock VSOCK: Only check error on skb_recv_datagram when skb is NULL 2016-04-19 20:42:01 -04:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-04-23 18:51:33 -04:00
x25
xfrm xfrm: align nlattr properly when needed 2016-04-23 20:13:25 -04:00
Kconfig
Makefile
compat.c
socket.c Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-04-14 00:39:15 -04:00
sysctl_net.c