Commit 401cbbb
net: bridge: fix pkt management during forwarding
There were several problems of pkt management during forwarding.
1. No need to do net_pkt_ref/net_pkt_unref around net_if_queue_tx.
2. Finally when completed forwarding, there was a net_pkt_unref for
pkt using cloning. However it also applied to pkt not using
cloning. This was causing pkt was released before sending.
3. Whether pkt cloning used or not, should not be decided by bridge
interfaces count. It's should be decided by interface count to
forward.
An example was sending pkt via bridge interface. If there were
two interfaces attached to bridge, cloning was needed but current
code won't.
Signed-off-by: Yangbo Lu <[email protected]>1 parent 1eb5c97 commit 401cbbb
1 file changed
+21
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | 354 | | |
357 | 355 | | |
358 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
359 | 366 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 367 | + | |
363 | 368 | | |
364 | 369 | | |
365 | 370 | | |
| |||
370 | 375 | | |
371 | 376 | | |
372 | 377 | | |
373 | | - | |
| 378 | + | |
374 | 379 | | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
378 | 383 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
393 | | - | |
394 | | - | |
395 | 394 | | |
396 | 395 | | |
397 | 396 | | |
398 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
399 | 401 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
0 commit comments