Commit 4c79579
bpf: Change bpf_fib_lookup to return lookup status
For ACLs implemented using either FIB rules or FIB entries, the BPF
program needs the FIB lookup status to be able to drop the packet.
Since the bpf_fib_lookup API has not reached a released kernel yet,
change the return code to contain an encoding of the FIB lookup
result and return the nexthop device index in the params struct.
In addition, inform the BPF program of any post FIB lookup reason as
to why the packet needs to go up the stack.
The fib result for unicast routes must have an egress device, so remove
the check that it is non-NULL.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>1 parent 3203c90 commit 4c79579
File tree
3 files changed
+81
-41
lines changed- include/uapi/linux
- net/core
- samples/bpf
3 files changed
+81
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1857 | 1857 | | |
1858 | 1858 | | |
1859 | 1859 | | |
1860 | | - | |
| 1860 | + | |
| 1861 | + | |
1861 | 1862 | | |
1862 | 1863 | | |
1863 | 1864 | | |
| |||
1873 | 1874 | | |
1874 | 1875 | | |
1875 | 1876 | | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
1879 | 1881 | | |
1880 | 1882 | | |
1881 | 1883 | | |
| |||
2612 | 2614 | | |
2613 | 2615 | | |
2614 | 2616 | | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
2615 | 2629 | | |
2616 | 2630 | | |
2617 | 2631 | | |
| |||
2625 | 2639 | | |
2626 | 2640 | | |
2627 | 2641 | | |
2628 | | - | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
2629 | 2647 | | |
2630 | 2648 | | |
2631 | 2649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4073 | 4073 | | |
4074 | 4074 | | |
4075 | 4075 | | |
| 4076 | + | |
4076 | 4077 | | |
4077 | | - | |
| 4078 | + | |
4078 | 4079 | | |
4079 | 4080 | | |
4080 | 4081 | | |
| |||
4098 | 4099 | | |
4099 | 4100 | | |
4100 | 4101 | | |
4101 | | - | |
| 4102 | + | |
4102 | 4103 | | |
4103 | 4104 | | |
4104 | 4105 | | |
| |||
4123 | 4124 | | |
4124 | 4125 | | |
4125 | 4126 | | |
4126 | | - | |
| 4127 | + | |
4127 | 4128 | | |
4128 | 4129 | | |
4129 | 4130 | | |
| |||
4135 | 4136 | | |
4136 | 4137 | | |
4137 | 4138 | | |
4138 | | - | |
4139 | | - | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
4140 | 4153 | | |
4141 | 4154 | | |
4142 | 4155 | | |
4143 | 4156 | | |
4144 | 4157 | | |
4145 | 4158 | | |
4146 | 4159 | | |
4147 | | - | |
| 4160 | + | |
4148 | 4161 | | |
4149 | 4162 | | |
4150 | 4163 | | |
4151 | 4164 | | |
4152 | 4165 | | |
4153 | 4166 | | |
4154 | | - | |
| 4167 | + | |
4155 | 4168 | | |
4156 | 4169 | | |
4157 | | - | |
4158 | | - | |
4159 | | - | |
4160 | 4170 | | |
4161 | 4171 | | |
4162 | 4172 | | |
| |||
4166 | 4176 | | |
4167 | 4177 | | |
4168 | 4178 | | |
4169 | | - | |
4170 | | - | |
| 4179 | + | |
| 4180 | + | |
4171 | 4181 | | |
4172 | | - | |
| 4182 | + | |
4173 | 4183 | | |
4174 | 4184 | | |
4175 | 4185 | | |
| |||
4190 | 4200 | | |
4191 | 4201 | | |
4192 | 4202 | | |
4193 | | - | |
| 4203 | + | |
4194 | 4204 | | |
4195 | 4205 | | |
4196 | 4206 | | |
4197 | 4207 | | |
4198 | 4208 | | |
4199 | 4209 | | |
4200 | 4210 | | |
4201 | | - | |
| 4211 | + | |
4202 | 4212 | | |
4203 | 4213 | | |
4204 | 4214 | | |
| |||
4225 | 4235 | | |
4226 | 4236 | | |
4227 | 4237 | | |
4228 | | - | |
| 4238 | + | |
4229 | 4239 | | |
4230 | 4240 | | |
4231 | 4241 | | |
| |||
4238 | 4248 | | |
4239 | 4249 | | |
4240 | 4250 | | |
4241 | | - | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
4242 | 4265 | | |
4243 | | - | |
4244 | | - | |
4245 | | - | |
| 4266 | + | |
| 4267 | + | |
4246 | 4268 | | |
4247 | 4269 | | |
4248 | 4270 | | |
| |||
4252 | 4274 | | |
4253 | 4275 | | |
4254 | 4276 | | |
4255 | | - | |
| 4277 | + | |
4256 | 4278 | | |
4257 | 4279 | | |
4258 | 4280 | | |
4259 | | - | |
| 4281 | + | |
4260 | 4282 | | |
4261 | 4283 | | |
4262 | 4284 | | |
| |||
4270 | 4292 | | |
4271 | 4293 | | |
4272 | 4294 | | |
4273 | | - | |
4274 | | - | |
| 4295 | + | |
| 4296 | + | |
4275 | 4297 | | |
4276 | | - | |
| 4298 | + | |
4277 | 4299 | | |
4278 | 4300 | | |
4279 | 4301 | | |
| |||
4315 | 4337 | | |
4316 | 4338 | | |
4317 | 4339 | | |
4318 | | - | |
| 4340 | + | |
4319 | 4341 | | |
4320 | 4342 | | |
4321 | 4343 | | |
| |||
4326 | 4348 | | |
4327 | 4349 | | |
4328 | 4350 | | |
4329 | | - | |
| 4351 | + | |
4330 | 4352 | | |
4331 | 4353 | | |
4332 | 4354 | | |
4333 | 4355 | | |
4334 | | - | |
| 4356 | + | |
4335 | 4357 | | |
4336 | 4358 | | |
4337 | 4359 | | |
4338 | 4360 | | |
4339 | | - | |
| 4361 | + | |
4340 | 4362 | | |
4341 | 4363 | | |
4342 | | - | |
| 4364 | + | |
4343 | 4365 | | |
4344 | | - | |
| 4366 | + | |
4345 | 4367 | | |
4346 | 4368 | | |
4347 | | - | |
| 4369 | + | |
4348 | 4370 | | |
4349 | 4371 | | |
4350 | 4372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
0 commit comments