Fix a logic bug which prevented the sending of UDP packet with 0 checksum.

This bug was introduced in r264212 and should be X-MFCed with that
revision, if UDP-Lite support if MFCed.
This commit is contained in:
Michael Tuexen 2014-05-09 14:15:48 +00:00
parent b7c7433150
commit d58c15339b

View File

@ -1375,7 +1375,8 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
faddr.s_addr = INADDR_BROADCAST;
if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0)
ui->ui_sum = 0xffff;
} else if (V_udp_cksum || !cscov_partial) {
} else if (V_udp_cksum || pr == IPPROTO_UDPLITE) {
/* for UDP-Lite full checksum coverage is requested */
if (inp->inp_flags & INP_ONESBCAST)
faddr.s_addr = INADDR_BROADCAST;
ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr,