]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: simplify error handling in tun_build_skb()
authorJason Wang <jasowang@redhat.com>
Wed, 12 Sep 2018 03:17:02 +0000 (11:17 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Sep 2018 16:25:40 +0000 (09:25 -0700)
commitf47b5ac690156f76029f196edef1c50fdb3ed790
tree3e8a43962d210ca2d9499f12dc2dc693ade1d512
parent35fb4d3748a68e44805ed5c887923dc80e980a80
tuntap: simplify error handling in tun_build_skb()

There's no need to duplicate page get logic in each action. So this
patch tries to get page and calculate the offset before processing XDP
actions (except for XDP_DROP), and undo them when meet errors (we
don't care the performance on errors). This will be used for factoring
out XDP logic.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c