dev.c (5bbcc0f595fadb4cac0eddc4401035ec0bd95b09) | dev.c (288b3de55aace830f13280985ec9e6bcbff33b1b) |
---|---|
1/* 2 * NET3 Protocol independent device support routines. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 7125 unchanged lines hidden (view full) --- 7134 7135 if (fd >= 0) { 7136 if (bpf_chk && __dev_xdp_attached(dev, bpf_chk, NULL)) 7137 return -EEXIST; 7138 if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) && 7139 __dev_xdp_attached(dev, bpf_op, NULL)) 7140 return -EBUSY; 7141 | 1/* 2 * NET3 Protocol independent device support routines. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 7125 unchanged lines hidden (view full) --- 7134 7135 if (fd >= 0) { 7136 if (bpf_chk && __dev_xdp_attached(dev, bpf_chk, NULL)) 7137 return -EEXIST; 7138 if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) && 7139 __dev_xdp_attached(dev, bpf_op, NULL)) 7140 return -EBUSY; 7141 |
7142 if (bpf_op == ops->ndo_bpf) 7143 prog = bpf_prog_get_type_dev(fd, BPF_PROG_TYPE_XDP, 7144 dev); 7145 else 7146 prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP); | 7142 prog = bpf_prog_get_type_dev(fd, BPF_PROG_TYPE_XDP, 7143 bpf_op == ops->ndo_bpf); |
7147 if (IS_ERR(prog)) 7148 return PTR_ERR(prog); 7149 } 7150 7151 err = dev_xdp_install(dev, bpf_op, extack, flags, prog); 7152 if (err < 0 && prog) 7153 bpf_prog_put(prog); 7154 --- 1691 unchanged lines hidden --- | 7144 if (IS_ERR(prog)) 7145 return PTR_ERR(prog); 7146 } 7147 7148 err = dev_xdp_install(dev, bpf_op, extack, flags, prog); 7149 if (err < 0 && prog) 7150 bpf_prog_put(prog); 7151 --- 1691 unchanged lines hidden --- |