View | Details | Raw Unified | Return to bug 275774
Collapse All | Expand All

(-)b/sys/netinet/udp_usrreq.c (-5 / +4 lines)
Lines 1061-1066 udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, Link Here
1061
	uint16_t cscov = 0;
1061
	uint16_t cscov = 0;
1062
	uint32_t flowid = 0;
1062
	uint32_t flowid = 0;
1063
	uint8_t flowtype = M_HASHTYPE_NONE;
1063
	uint8_t flowtype = M_HASHTYPE_NONE;
1064
	bool use_cached_route = false;
1064
1065
1065
	inp = sotoinpcb(so);
1066
	inp = sotoinpcb(so);
1066
	KASSERT(inp != NULL, ("udp_send: inp == NULL"));
1067
	KASSERT(inp != NULL, ("udp_send: inp == NULL"));
Lines 1097-1105 udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, Link Here
1097
	 * We will need network epoch in either case, to safely lookup into
1098
	 * We will need network epoch in either case, to safely lookup into
1098
	 * pcb hash.
1099
	 * pcb hash.
1099
	 */
1100
	 */
1100
	if (sin == NULL ||
1101
	use_cached_route = sin == NULL || (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0);
1101
	    (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) ||
1102
	if (use_cached_route || (flags & PRUS_IPV6) != 0)
1102
	    (flags & PRUS_IPV6) != 0)
1103
		INP_WLOCK(inp);
1103
		INP_WLOCK(inp);
1104
	else
1104
	else
1105
		INP_RLOCK(inp);
1105
		INP_RLOCK(inp);
Lines 1450-1456 udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, Link Here
1450
	else
1450
	else
1451
		UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u);
1451
		UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u);
1452
	error = ip_output(m, inp->inp_options,
1452
	error = ip_output(m, inp->inp_options,
1453
	    INP_WLOCKED(inp) ? &inp->inp_route : NULL, ipflags,
1453
	    use_cached_route ? &inp->inp_route : NULL, ipflags,
1454
	    inp->inp_moptions, inp);
1454
	    inp->inp_moptions, inp);
1455
	INP_UNLOCK(inp);
1455
	INP_UNLOCK(inp);
1456
	NET_EPOCH_EXIT(et);
1456
	NET_EPOCH_EXIT(et);
1457
- 

Return to bug 275774