Lines 315-320
udp6_input(struct mbuf **mp, int *offp, int proto)
Link Here
|
315 |
struct inpcb *last; |
315 |
struct inpcb *last; |
316 |
struct inpcbhead *pcblist; |
316 |
struct inpcbhead *pcblist; |
317 |
struct ip6_moptions *imo; |
317 |
struct ip6_moptions *imo; |
|
|
318 |
bool inp_locked = false; |
318 |
|
319 |
|
319 |
/* |
320 |
/* |
320 |
* In the event that laddr should be set to the link-local |
321 |
* In the event that laddr should be set to the link-local |
Lines 392-399
udp6_input(struct mbuf **mp, int *offp, int proto)
Link Here
|
392 |
INP_RUNLOCK(inp); /* XXX */ |
393 |
INP_RUNLOCK(inp); /* XXX */ |
393 |
continue; |
394 |
continue; |
394 |
} |
395 |
} |
395 |
|
396 |
inp_locked = true; |
396 |
INP_RUNLOCK(inp); |
|
|
397 |
} |
397 |
} |
398 |
if (last != NULL) { |
398 |
if (last != NULL) { |
399 |
struct mbuf *n; |
399 |
struct mbuf *n; |
Lines 409-414
udp6_input(struct mbuf **mp, int *offp, int proto)
Link Here
|
409 |
UDP_PROBE(receive, NULL, last, |
409 |
UDP_PROBE(receive, NULL, last, |
410 |
ip6, last, uh); |
410 |
ip6, last, uh); |
411 |
if (udp6_append(last, n, off, fromsa)) { |
411 |
if (udp6_append(last, n, off, fromsa)) { |
|
|
412 |
if (inp_locked) |
413 |
INP_RUNLOCK(inp); |
412 |
/* XXX-BZ do we leak m here? */ |
414 |
/* XXX-BZ do we leak m here? */ |
413 |
*mp = NULL; |
415 |
*mp = NULL; |
414 |
return (IPPROTO_DONE); |
416 |
return (IPPROTO_DONE); |
Lines 429-434
udp6_input(struct mbuf **mp, int *offp, int proto)
Link Here
|
429 |
if ((last->inp_socket->so_options & |
431 |
if ((last->inp_socket->so_options & |
430 |
(SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) |
432 |
(SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) |
431 |
break; |
433 |
break; |
|
|
434 |
|
435 |
if (inp_locked) { |
436 |
INP_RUNLOCK(inp); |
437 |
inp_locked = false; |
438 |
} |
432 |
} |
439 |
} |
433 |
|
440 |
|
434 |
if (last == NULL) { |
441 |
if (last == NULL) { |
Lines 441-447
udp6_input(struct mbuf **mp, int *offp, int proto)
Link Here
|
441 |
UDPSTAT_INC(udps_noportmcast); |
448 |
UDPSTAT_INC(udps_noportmcast); |
442 |
goto badunlocked; |
449 |
goto badunlocked; |
443 |
} |
450 |
} |
444 |
INP_RLOCK(last); |
451 |
|
|
|
452 |
if (!inp_locked) |
453 |
INP_RLOCK(last); |
454 |
|
445 |
if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { |
455 |
if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { |
446 |
if (nxt == IPPROTO_UDPLITE) |
456 |
if (nxt == IPPROTO_UDPLITE) |
447 |
UDPLITE_PROBE(receive, NULL, last, ip6, last, uh); |
457 |
UDPLITE_PROBE(receive, NULL, last, ip6, last, uh); |