Set the IPv4 version in the IP header for UDP and UDPLite.

This commit is contained in:
Michael Tuexen 2018-07-21 02:14:13 +00:00
parent cecf6c6e9c
commit 34fc9072ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336574

View File

@ -1397,6 +1397,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
*/
ui = mtod(m, struct udpiphdr *);
bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */
ui->ui_v = IPVERSION << 4;
ui->ui_pr = pr;
ui->ui_src = laddr;
ui->ui_dst = faddr;
@ -1419,8 +1420,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
* the entire UDPLite packet is covered by the checksum.
*/
cscov_partial = (cscov == 0) ? 0 : 1;
} else
ui->ui_v = IPVERSION << 4;
}
/*
* Set the Don't Fragment bit in the IP header.