Amir Vadai
71d0ed7079
net/act_pedit: Support using offset relative to the conventional network headers
...
Extend pedit to enable the user setting offset relative to network
headers. This change would enable to work with more complex header
schemes (vs the simple IPv4 case) where setting a fixed offset relative
to the network header is not enough.
After this patch, the action has information about the exact header type
and field inside this header. This information could be used later on
for hardware offloading of pedit.
Backward compatibility was being kept:
1. Old kernel <-> new userspace
2. New kernel <-> old userspace
3. add rule using new userspace <-> dump using old userspace
4. add rule using old userspace <-> dump using new userspace
When using the extended api, new netlink attributes are being used. This
way, operation will fail in (1) and (3) - and no malformed rule be added
or dumped. Of course, new user space that doesn't need the new
functionality can use the old netlink attributes and operation will
succeed.
Since action can support both api's, (2) should work, and it is easy to
write the new user space to have (4) work.
The action is having a strict check that only header types and commands
it can handle are accepted. This way future additions will be much
easier.
Usage example:
$ tc filter add dev enp0s9 protocol ip parent ffff: \
flower \
ip_proto tcp \
dst_port 80 \
action pedit munge tcp dport set 8080 pipe \
action mirred egress redirect dev veth0
Will forward tcp port whose original dest port is 80, while modifying
the destination port to 8080.
Signed-off-by: Amir Vadai <amir@vadai.me>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-10 13:18:33 -05:00
..
9p
bluetooth
Bluetooth: __ variants of u8 and friends are not neccessary inside kernel
2016-11-27 07:41:05 +01:00
caif
irda
iucv
netfilter
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
2017-02-03 16:58:20 -05:00
netns
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
2017-02-03 16:58:20 -05:00
nfc
phonet
sctp
sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter
2017-02-09 16:57:38 -05:00
tc_act
net/act_pedit: Support using offset relative to the conventional network headers
2017-02-10 13:18:33 -05:00
6lowpan.h
act_api.h
net sched actions: Add support for user cookies
2017-01-25 12:37:04 -05:00
addrconf.h
inet: collapse ipv4/v6 rcv_saddr_equal functions into one
2017-01-18 13:04:28 -05:00
af_ieee802154.h
af_rxrpc.h
rxrpc: Rewrite the data and ack handling code
2016-09-08 11:10:12 +01:00
af_unix.h
af_unix: split 'u->readlock' into two: 'iolock' and 'bindlock'
2016-09-04 13:29:29 -07:00
af_vsock.h
VSOCK: Introduce virtio_vsock_common.ko
2016-08-02 02:57:29 +03:00
ah.h
arp.h
net: add confirm_neigh method to dst_ops
2017-02-07 13:07:46 -05:00
atmclip.h
ax25.h
ax88796.h
bond_3ad.h
bond_alb.h
bond_options.h
bonding.h
netns: make struct pernet_operations::id unsigned int
2016-11-18 10:59:15 -05:00
busy_poll.h
udp: enable busy polling for all sockets
2016-11-18 10:44:31 -05:00
calipso.h
cfg80211-wext.h
cfg80211.h
cfg80211: Fix documentation for connect result
2017-01-13 09:47:08 +01:00
cfg802154.h
checksum.h
csum: eliminate sparse warning in remcsum_unadjust()
2017-01-20 12:12:13 -05:00
cipso_ipv4.h
netlabel: out of bound access in cipso_v4_validate()
2017-02-04 19:44:22 -05:00
cls_cgroup.h
codel.h
codel_impl.h
codel_qdisc.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h
devlink: Add E-Switch inline mode control
2016-11-24 16:01:14 -05:00
dn.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
dsa.h
net: dsa: Add support for platform data
2017-02-07 10:51:45 -05:00
dsfield.h
dst.h
net: pending_confirm is not used anymore
2017-02-07 13:07:47 -05:00
dst_cache.h
dst_metadata.h
net/dst: Add dst port to dst_metadata utility functions
2016-11-09 13:41:54 -05:00
dst_ops.h
net: add confirm_neigh method to dst_ops
2017-02-07 13:07:46 -05:00
esp.h
ethoc.h
fib_rules.h
net: core: add UID to flows, rules, and routes
2016-11-04 14:45:23 -04:00
firewire.h
flow.h
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2016-12-12 19:25:04 -08:00
flow_dissector.h
flow disector: ARP support
2017-01-11 11:02:47 -05:00
flowcache.h
net/flowcache: Convert to hotplug state machine
2016-11-09 23:45:28 +01:00
fou.h
fq.h
fq.h: Port memory limit mechanism from fq_codel
2016-09-30 13:29:21 +02:00
fq_impl.h
fq.h: Port memory limit mechanism from fq_codel
2016-09-30 13:29:21 +02:00
garp.h
gen_stats.h
net_sched: gen_estimator: complete rewrite of rate estimators
2016-12-05 15:21:59 -05:00
genetlink.h
genetlink: Make family a signed integer.
2016-11-13 12:14:59 -05:00
geneve.h
gre.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2016-08-18 01:17:32 -04:00
gro_cells.h
gro_cells: move to net/core/gro_cells.c
2017-02-08 14:38:18 -05:00
gtp.h
gue.h
hwbm.h
icmp.h
ieee80211_radiotap.h
wireless: radiotap: fix timestamp sampling position values
2016-10-19 12:11:36 +02:00
ieee802154_netdev.h
if_inet6.h
net/ipv6: allow sysctl to change link-local address generation mode
2017-01-27 10:25:34 -05:00
ife.h
net: Introduce ife encapsulation module
2017-02-03 15:16:45 -05:00
ila.h
inet6_connection_sock.h
inet: drop ->bind_conflict
2017-01-18 13:04:28 -05:00
inet6_hashtables.h
inet_common.h
net/tcp-fastopen: make connect()'s return case more consistent with non-TFO
2017-01-25 14:12:21 -05:00
inet_connection_sock.h
inet: drop ->bind_conflict
2017-01-18 13:04:28 -05:00
inet_ecn.h
ipv6: suppress sparse warnings in IP6_ECN_set_ce()
2016-08-13 15:08:00 -07:00
inet_frag.h
net: remove bh disabling around percpu_counter accesses
2017-01-20 11:27:22 -05:00
inet_hashtables.h
inet: reset tb->fastreuseport when adding a reuseport sk
2017-01-18 13:04:29 -05:00
inet_sock.h
net/tcp-fastopen: Add new API support
2017-01-25 14:04:38 -05:00
inet_timewait_sock.h
ipv4: Namespaceify tcp_tw_recycle and tcp_max_tw_buckets knob
2016-12-29 11:38:31 -05:00
inetpeer.h
ip.h
Introduce a sysctl that modifies the value of PROT_SOCK.
2017-01-24 12:10:51 -05:00
ip6_checksum.h
ip6_fib.h
net: ipv6: Allow shorthand delete of all nexthops in multipath route
2017-02-04 19:58:14 -05:00
ip6_route.h
net: inet: Support UID-based routing in IP protocols.
2016-11-04 14:45:23 -04:00
ip6_tunnel.h
ip6_tunnel: Clear IP6CB in ip6tunnel_xmit()
2016-11-02 15:18:36 -04:00
ip_fib.h
ipv4: fib: Add events for FIB replace and append
2017-02-10 11:32:13 -05:00
ip_tunnels.h
ip_tunnels: new IP_TUNNEL_INFO_BRIDGE flag for ip_tunnel_info mode
2017-02-03 15:21:21 -05:00
ip_vs.h
ipvs: free ip_vs_dest structs when refcnt=0
2017-02-02 14:31:57 +01:00
ipcomp.h
ipconfig.h
ipv6.h
ipv6: fix flow labels when the traffic class is non-0
2017-01-31 13:16:59 -05:00
ipx.h
iw_handler.h
wext: uninline stream addition functions
2017-01-13 09:38:42 +01:00
kcm.h
kcm: Use stream parser
2016-08-17 19:36:23 -04:00
l3mdev.h
net: ipv4: Do not drop to make_route if oif is l3mdev
2016-10-13 12:05:26 -04:00
lapb.h
lib80211.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
lwtunnel.h
lwtunnel: remove device arg to lwtunnel_build_state
2017-01-30 15:14:22 -05:00
mac80211.h
mac80211: Add RX flag to indicate ICV stripped
2017-01-12 10:15:18 +01:00
mac802154.h
mip6.h
mld.h
mpls.h
openvswitch: use mpls_hdr
2016-10-03 02:00:22 -04:00
mpls_iptunnel.h
mrp.h
ncsi.h
net/ncsi: Introduce ncsi_stop_dev()
2016-10-04 02:11:51 -04:00
ndisc.h
net: add confirm_neigh method to dst_ops
2017-02-07 13:07:46 -05:00
neighbour.h
net_namespace.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2016-11-22 13:27:16 -05:00
net_ratelimit.h
netevent.h
netlabel.h
netlink.h
net: ipv6: Change notifications for multipath add to RTA_MULTIPATH
2017-02-04 19:58:14 -05:00
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h
p8022.h
ping.h
pkt_cls.h
sched: move tcf_proto_destroy and tcf_destroy_chain helpers into cls_api
2017-02-10 11:38:08 -05:00
pkt_sched.h
net: make default TX queue length a defined constant
2016-11-07 20:15:55 -05:00
pptp.h
pptp: Refactor the struct and macros of PPTP codes
2016-08-15 10:55:53 -07:00
protocol.h
psample.h
net: Introduce psample, a new genetlink channel for packet sampling
2017-01-24 13:44:28 -05:00
psnap.h
raw.h
net: ip, diag -- Add diag interface for raw sockets
2016-10-23 19:35:24 -04:00
rawv6.h
net: ip, diag -- Add diag interface for raw sockets
2016-10-23 19:35:24 -04:00
red.h
ktime: Get rid of the union
2016-12-25 17:21:22 +01:00
regulatory.h
request_sock.h
ipv4: Namespaceify tcp_max_syn_backlog knob
2016-12-29 11:38:31 -05:00
rose.h
route.h
net: inet: Support UID-based routing in IP protocols.
2016-11-04 14:45:23 -04:00
rtnetlink.h
net: AF-specific RTM_GETSTATS attributes
2017-01-17 14:38:43 -05:00
sch_generic.h
sched: move tcf_proto_destroy and tcf_destroy_chain helpers into cls_api
2017-02-10 11:38:08 -05:00
scm.h
secure_seq.h
tcp: randomize tcp timestamp offsets for each connection
2016-12-02 12:49:59 -05:00
seg6.h
ipv6: sr: add core files for SR HMAC support
2016-11-09 20:40:06 -05:00
seg6_hmac.h
ipv6: sr: add core files for SR HMAC support
2016-11-09 20:40:06 -05:00
slhc_vj.h
smc.h
smc: netlink interface for SMC sockets
2017-01-09 16:07:41 -05:00
snmp.h
sock.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2017-02-07 16:29:30 -05:00
sock_reuseport.h
Space.h
stp.h
strparser.h
kcm: Remove TCP specific references from kcm and strparser
2016-08-28 23:32:41 -04:00
switchdev.h
switchdev: bridge: Offload mc router ports
2017-02-10 11:46:39 -05:00
tcp.h
net/tcp-fastopen: Add new API support
2017-01-25 14:04:38 -05:00
tcp_states.h
timewait_sock.h
transp_v6.h
tso.h
udp.h
inet: collapse ipv4/v6 rcv_saddr_equal functions into one
2017-01-18 13:04:28 -05:00
udp_tunnel.h
udplite.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2016-12-16 10:24:44 -08:00
vsock_addr.h
vxlan.h
vxlan: remove unsed vxlan_dev_dst_port()
2016-11-15 12:16:13 -05:00
wext.h
wimax.h
x25.h
x25device.h
xfrm.h
esp4: Avoid skb_cow_data whenever possible
2017-01-17 10:22:57 +01:00