summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2014-05-13 06:05:53 +0000
committerkevlo <kevlo@FreeBSD.org>2014-05-13 06:05:53 +0000
commit69da76e9e5a9758fee9f8286827143e4608bb87a (patch)
tree9eae681ae0fb7e2b696040fefa6df9b3b66c7360 /sys/netinet/in_pcb.c
parentab793415d02166fdd7cfea2301a03a903362e3f9 (diff)
downloadFreeBSD-src-69da76e9e5a9758fee9f8286827143e4608bb87a.zip
FreeBSD-src-69da76e9e5a9758fee9f8286827143e4608bb87a.tar.gz
MFC r264212,r264213,r264248,r265776,r265811,r265909:
- Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian - Fix a logic bug which prevented the sending of UDP packet with 0 checksum. - Disable TX checksum offload for UDP-Lite completely. It wasn't used for partial checksum coverage, but even for full checksum coverage it doesn't work.
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 40f701e..dd2db49 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -386,13 +386,14 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp,
lastport = &pcbinfo->ipi_lastport;
}
/*
- * For UDP, use random port allocation as long as the user
+ * For UDP(-Lite), use random port allocation as long as the user
* allows it. For TCP (and as of yet unknown) connections,
* use random port allocation only if the user allows it AND
* ipport_tick() allows it.
*/
if (V_ipport_randomized &&
- (!V_ipport_stoprandom || pcbinfo == &V_udbinfo))
+ (!V_ipport_stoprandom || pcbinfo == &V_udbinfo ||
+ pcbinfo == &V_ulitecbinfo))
dorandom = 1;
else
dorandom = 0;
@@ -402,8 +403,8 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp,
*/
if (first == last)
dorandom = 0;
- /* Make sure to not include UDP packets in the count. */
- if (pcbinfo != &V_udbinfo)
+ /* Make sure to not include UDP(-Lite) packets in the count. */
+ if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo)
V_ipport_tcpallocs++;
/*
* Instead of having two loops further down counting up or down
OpenPOWER on IntegriCloud