tun.c (4f23aff8713c1f98735f7290a2cde63845b7ec88) tun.c (291aeb2b1dba0d0296673d994200824a7185585e)
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1712 unchanged lines hidden (view full) ---

1721 /* fall through */
1722 case XDP_ABORTED:
1723 trace_xdp_exception(tun->dev, xdp_prog, act);
1724 /* fall through */
1725 case XDP_DROP:
1726 goto err_xdp;
1727 }
1728 }
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1712 unchanged lines hidden (view full) ---

1721 /* fall through */
1722 case XDP_ABORTED:
1723 trace_xdp_exception(tun->dev, xdp_prog, act);
1724 /* fall through */
1725 case XDP_DROP:
1726 goto err_xdp;
1727 }
1728 }
1729 rcu_read_unlock();
1730 local_bh_enable();
1729
1730 skb = build_skb(buf, buflen);
1731
1732 skb = build_skb(buf, buflen);
1731 if (!skb) {
1732 rcu_read_unlock();
1733 local_bh_enable();
1733 if (!skb)
1734 return ERR_PTR(-ENOMEM);
1734 return ERR_PTR(-ENOMEM);
1735 }
1736
1737 skb_reserve(skb, pad - delta);
1738 skb_put(skb, len);
1739 get_page(alloc_frag->page);
1740 alloc_frag->offset += buflen;
1741
1735
1736 skb_reserve(skb, pad - delta);
1737 skb_put(skb, len);
1738 get_page(alloc_frag->page);
1739 alloc_frag->offset += buflen;
1740
1742 rcu_read_unlock();
1743 local_bh_enable();
1744
1745 return skb;
1746
1747err_redirect:
1748 put_page(alloc_frag->page);
1749err_xdp:
1750 rcu_read_unlock();
1751 local_bh_enable();
1752 this_cpu_inc(tun->pcpu_stats->rx_dropped);

--- 1820 unchanged lines hidden ---
1741 return skb;
1742
1743err_redirect:
1744 put_page(alloc_frag->page);
1745err_xdp:
1746 rcu_read_unlock();
1747 local_bh_enable();
1748 this_cpu_inc(tun->pcpu_stats->rx_dropped);

--- 1820 unchanged lines hidden ---