[Midnightbsd-cvs] src [6952] U trunk/sys: UDP Lite aka RFC 3828 support.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Nov 16 15:36:06 EST 2014
Revision: 6952
http://svnweb.midnightbsd.org/src/?rev=6952
Author: laffer1
Date: 2014-11-16 15:36:05 -0500 (Sun, 16 Nov 2014)
Log Message:
-----------
UDP Lite aka RFC 3828 support.
Modified Paths:
--------------
trunk/UPDATING
trunk/lib/libc/net/getaddrinfo.c
trunk/sys/netinet/in.c
trunk/sys/netinet/in.h
trunk/sys/netinet/in_pcb.c
trunk/sys/netinet/in_proto.c
trunk/sys/netinet/udp_usrreq.c
trunk/sys/netinet/udp_var.h
trunk/sys/netinet6/in6_ifattach.c
trunk/sys/netinet6/in6_proto.c
trunk/sys/netinet6/udp6_usrreq.c
trunk/sys/netinet6/udp6_var.h
Property Changed:
----------------
trunk/sys/netinet/cc.h
trunk/sys/netinet/icmp6.h
trunk/sys/netinet/icmp_var.h
trunk/sys/netinet/if_atm.h
trunk/sys/netinet/if_ether.h
trunk/sys/netinet/igmp.h
trunk/sys/netinet/igmp_var.h
trunk/sys/netinet/in.h
trunk/sys/netinet/in_gif.h
trunk/sys/netinet/in_pcb.h
trunk/sys/netinet/in_systm.h
trunk/sys/netinet/in_var.h
trunk/sys/netinet/ip.h
trunk/sys/netinet/ip6.h
trunk/sys/netinet/ip_carp.h
trunk/sys/netinet/ip_divert.h
trunk/sys/netinet/ip_dummynet.h
trunk/sys/netinet/ip_ecn.h
trunk/sys/netinet/ip_encap.h
trunk/sys/netinet/ip_fw.h
trunk/sys/netinet/ip_gre.h
trunk/sys/netinet/ip_icmp.h
trunk/sys/netinet/ip_ipsec.h
trunk/sys/netinet/ip_mroute.h
trunk/sys/netinet/ip_options.h
trunk/sys/netinet/ip_var.h
trunk/sys/netinet/pim.h
trunk/sys/netinet/pim_var.h
trunk/sys/netinet/sctp.h
trunk/sys/netinet/sctp_asconf.h
trunk/sys/netinet/sctp_auth.h
trunk/sys/netinet/sctp_bsd_addr.h
trunk/sys/netinet/sctp_constants.h
trunk/sys/netinet/sctp_crc32.h
trunk/sys/netinet/sctp_dtrace_declare.h
trunk/sys/netinet/sctp_dtrace_define.h
trunk/sys/netinet/sctp_header.h
trunk/sys/netinet/sctp_indata.h
trunk/sys/netinet/sctp_input.h
trunk/sys/netinet/sctp_lock_bsd.h
trunk/sys/netinet/sctp_os.h
trunk/sys/netinet/sctp_os_bsd.h
trunk/sys/netinet/sctp_output.h
trunk/sys/netinet/sctp_pcb.h
trunk/sys/netinet/sctp_peeloff.h
trunk/sys/netinet/sctp_structs.h
trunk/sys/netinet/sctp_sysctl.h
trunk/sys/netinet/sctp_timer.h
trunk/sys/netinet/sctp_uio.h
trunk/sys/netinet/sctp_var.h
trunk/sys/netinet/sctputil.h
trunk/sys/netinet/tcp.h
trunk/sys/netinet/tcp_debug.h
trunk/sys/netinet/tcp_fsm.h
trunk/sys/netinet/tcp_hostcache.h
trunk/sys/netinet/tcp_lro.h
trunk/sys/netinet/tcp_offload.h
trunk/sys/netinet/tcp_seq.h
trunk/sys/netinet/tcp_syncache.h
trunk/sys/netinet/tcp_timer.h
trunk/sys/netinet/tcp_var.h
trunk/sys/netinet/tcpip.h
trunk/sys/netinet/toedev.h
trunk/sys/netinet/udp.h
trunk/sys/netinet/udp_var.h
trunk/sys/netinet6/dest6.c
trunk/sys/netinet6/frag6.c
trunk/sys/netinet6/icmp6.c
trunk/sys/netinet6/icmp6.h
trunk/sys/netinet6/in6.c
trunk/sys/netinet6/in6.h
trunk/sys/netinet6/in6_cksum.c
trunk/sys/netinet6/in6_gif.c
trunk/sys/netinet6/in6_gif.h
trunk/sys/netinet6/in6_ifattach.c
trunk/sys/netinet6/in6_ifattach.h
trunk/sys/netinet6/in6_mcast.c
trunk/sys/netinet6/in6_pcb.c
trunk/sys/netinet6/in6_pcb.h
trunk/sys/netinet6/in6_pcbgroup.c
trunk/sys/netinet6/in6_proto.c
trunk/sys/netinet6/in6_rmx.c
trunk/sys/netinet6/in6_src.c
trunk/sys/netinet6/in6_var.h
trunk/sys/netinet6/ip6.h
trunk/sys/netinet6/ip6_ecn.h
trunk/sys/netinet6/ip6_forward.c
trunk/sys/netinet6/ip6_id.c
trunk/sys/netinet6/ip6_input.c
trunk/sys/netinet6/ip6_ipsec.c
trunk/sys/netinet6/ip6_ipsec.h
trunk/sys/netinet6/ip6_mroute.c
trunk/sys/netinet6/ip6_mroute.h
trunk/sys/netinet6/ip6_output.c
trunk/sys/netinet6/ip6_var.h
trunk/sys/netinet6/ip6protosw.h
trunk/sys/netinet6/mld6.c
trunk/sys/netinet6/mld6.h
trunk/sys/netinet6/mld6_var.h
trunk/sys/netinet6/nd6.c
trunk/sys/netinet6/nd6.h
trunk/sys/netinet6/nd6_nbr.c
trunk/sys/netinet6/nd6_rtr.c
trunk/sys/netinet6/pim6.h
trunk/sys/netinet6/pim6_var.h
trunk/sys/netinet6/raw_ip6.c
trunk/sys/netinet6/raw_ip6.h
trunk/sys/netinet6/route6.c
trunk/sys/netinet6/scope6.c
trunk/sys/netinet6/scope6_var.h
trunk/sys/netinet6/sctp6_usrreq.c
trunk/sys/netinet6/sctp6_var.h
trunk/sys/netinet6/send.c
trunk/sys/netinet6/send.h
trunk/sys/netinet6/tcp6_var.h
trunk/sys/netinet6/udp6_usrreq.c
trunk/sys/netinet6/udp6_var.h
Modified: trunk/UPDATING
===================================================================
--- trunk/UPDATING 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/UPDATING 2014-11-16 20:36:05 UTC (rev 6952)
@@ -1,5 +1,11 @@
Updating Information for MidnightBSD users.
+20141117:
+ Add support for UDP Lite protocol aka RFC 3828 to IPv4 and IPv6
+ stacks.
+
+ Based on FreeBSD's 10.1 patch.
+
20141109:
Fix building perl during buildworld when the GDBM port is installed.
Modified: trunk/lib/libc/net/getaddrinfo.c
===================================================================
--- trunk/lib/libc/net/getaddrinfo.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/lib/libc/net/getaddrinfo.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -171,6 +171,7 @@
{ PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
{ PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
{ PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
+ { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 },
{ PF_INET6, SOCK_RAW, ANY, NULL, 0x05 },
#endif
{ PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
@@ -177,6 +178,7 @@
{ PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
{ PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
{ PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
+ { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 },
{ PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
{ -1, 0, 0, NULL, 0 },
};
@@ -1489,6 +1491,9 @@
case IPPROTO_SCTP:
proto = "sctp";
break;
+ case IPPROTO_UDPLITE:
+ proto = "udplite";
+ break;
default:
proto = NULL;
break;
Index: trunk/sys/netinet/cc.h
===================================================================
--- trunk/sys/netinet/cc.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/cc.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/cc.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet/icmp6.h
===================================================================
--- trunk/sys/netinet/icmp6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/icmp6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/icmp6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/icmp_var.h
===================================================================
--- trunk/sys/netinet/icmp_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/icmp_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/icmp_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/if_atm.h
===================================================================
--- trunk/sys/netinet/if_atm.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/if_atm.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/if_atm.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/if_ether.h
===================================================================
--- trunk/sys/netinet/if_ether.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/if_ether.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/if_ether.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/igmp.h
===================================================================
--- trunk/sys/netinet/igmp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/igmp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/igmp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/igmp_var.h
===================================================================
--- trunk/sys/netinet/igmp_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/igmp_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/igmp_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Modified: trunk/sys/netinet/in.c
===================================================================
--- trunk/sys/netinet/in.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -1266,6 +1266,7 @@
in_pcbpurgeif0(&V_ripcbinfo, ifp);
in_pcbpurgeif0(&V_udbinfo, ifp);
+ in_pcbpurgeif0(&V_ulitecbinfo, ifp);
in_purgemaddrs(ifp);
}
Modified: trunk/sys/netinet/in.h
===================================================================
--- trunk/sys/netinet/in.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in.h 2014-11-16 20:36:05 UTC (rev 6952)
@@ -237,11 +237,16 @@
#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */
#define IPPROTO_SCTP 132 /* SCTP */
#define IPPROTO_MH 135 /* IPv6 Mobility Header */
+#define IPPROTO_UDPLITE 136 /* UDP-Lite */
+#define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */
+#define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */
/* 101-254: Partly Unassigned */
#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
#define IPPROTO_CARP 112 /* CARP */
#define IPPROTO_PGM 113 /* PGM */
#define IPPROTO_PFSYNC 240 /* PFSYNC */
+#define IPPROTO_RESERVED_253 253 /* Reserved */
+#define IPPROTO_RESERVED_254 254 /* Reserved */
/* 255: Reserved */
/* BSD Private, local use, namespace incursion, no longer used */
#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */
Property changes on: trunk/sys/netinet/in.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet/in_gif.h
===================================================================
--- trunk/sys/netinet/in_gif.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_gif.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/in_gif.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Modified: trunk/sys/netinet/in_pcb.c
===================================================================
--- trunk/sys/netinet/in_pcb.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_pcb.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -388,13 +388,14 @@
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;
@@ -404,8 +405,8 @@
*/
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
Index: trunk/sys/netinet/in_pcb.h
===================================================================
--- trunk/sys/netinet/in_pcb.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_pcb.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/in_pcb.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Modified: trunk/sys/netinet/in_proto.c
===================================================================
--- trunk/sys/netinet/in_proto.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_proto.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -184,6 +184,20 @@
},
#endif /* SCTP */
{
+ .pr_type = SOCK_DGRAM,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_UDPLITE,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = udp_input,
+ .pr_ctlinput = udplite_ctlinput,
+ .pr_ctloutput = udp_ctloutput,
+ .pr_init = udplite_init,
+#ifdef VIMAGE
+ .pr_destroy = udplite_destroy,
+#endif
+ .pr_usrreqs = &udp_usrreqs
+},
+{
.pr_type = SOCK_RAW,
.pr_domain = &inetdomain,
.pr_protocol = IPPROTO_RAW,
Index: trunk/sys/netinet/in_systm.h
===================================================================
--- trunk/sys/netinet/in_systm.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_systm.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/in_systm.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/in_var.h
===================================================================
--- trunk/sys/netinet/in_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/in_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/in_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip.h
===================================================================
--- trunk/sys/netinet/ip.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip6.h
===================================================================
--- trunk/sys/netinet/ip6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_carp.h
===================================================================
--- trunk/sys/netinet/ip_carp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_carp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_carp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_divert.h
===================================================================
--- trunk/sys/netinet/ip_divert.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_divert.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_divert.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_dummynet.h
===================================================================
--- trunk/sys/netinet/ip_dummynet.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_dummynet.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_dummynet.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_ecn.h
===================================================================
--- trunk/sys/netinet/ip_ecn.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_ecn.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_ecn.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_encap.h
===================================================================
--- trunk/sys/netinet/ip_encap.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_encap.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_encap.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_fw.h
===================================================================
--- trunk/sys/netinet/ip_fw.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_fw.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_fw.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_gre.h
===================================================================
--- trunk/sys/netinet/ip_gre.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_gre.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_gre.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_icmp.h
===================================================================
--- trunk/sys/netinet/ip_icmp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_icmp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_icmp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_ipsec.h
===================================================================
--- trunk/sys/netinet/ip_ipsec.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_ipsec.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_ipsec.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_mroute.h
===================================================================
--- trunk/sys/netinet/ip_mroute.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_mroute.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_mroute.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/ip_options.h
===================================================================
--- trunk/sys/netinet/ip_options.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_options.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_options.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/ip_var.h
===================================================================
--- trunk/sys/netinet/ip_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/ip_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/ip_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet/pim.h
===================================================================
--- trunk/sys/netinet/pim.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/pim.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/pim.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/pim_var.h
===================================================================
--- trunk/sys/netinet/pim_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/pim_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/pim_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/sctp.h
===================================================================
--- trunk/sys/netinet/sctp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_asconf.h
===================================================================
--- trunk/sys/netinet/sctp_asconf.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_asconf.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_asconf.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_auth.h
===================================================================
--- trunk/sys/netinet/sctp_auth.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_auth.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_auth.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_bsd_addr.h
===================================================================
--- trunk/sys/netinet/sctp_bsd_addr.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_bsd_addr.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_bsd_addr.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_constants.h
===================================================================
--- trunk/sys/netinet/sctp_constants.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_constants.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_constants.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_crc32.h
===================================================================
--- trunk/sys/netinet/sctp_crc32.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_crc32.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_crc32.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_dtrace_declare.h
===================================================================
--- trunk/sys/netinet/sctp_dtrace_declare.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_dtrace_declare.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_dtrace_declare.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet/sctp_dtrace_define.h
===================================================================
--- trunk/sys/netinet/sctp_dtrace_define.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_dtrace_define.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_dtrace_define.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet/sctp_header.h
===================================================================
--- trunk/sys/netinet/sctp_header.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_header.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_header.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_indata.h
===================================================================
--- trunk/sys/netinet/sctp_indata.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_indata.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_indata.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_input.h
===================================================================
--- trunk/sys/netinet/sctp_input.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_input.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_input.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_lock_bsd.h
===================================================================
--- trunk/sys/netinet/sctp_lock_bsd.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_lock_bsd.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_lock_bsd.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_os.h
===================================================================
--- trunk/sys/netinet/sctp_os.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_os.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_os.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_os_bsd.h
===================================================================
--- trunk/sys/netinet/sctp_os_bsd.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_os_bsd.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_os_bsd.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_output.h
===================================================================
--- trunk/sys/netinet/sctp_output.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_output.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_output.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_pcb.h
===================================================================
--- trunk/sys/netinet/sctp_pcb.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_pcb.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_pcb.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_peeloff.h
===================================================================
--- trunk/sys/netinet/sctp_peeloff.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_peeloff.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_peeloff.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_structs.h
===================================================================
--- trunk/sys/netinet/sctp_structs.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_structs.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_structs.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_sysctl.h
===================================================================
--- trunk/sys/netinet/sctp_sysctl.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_sysctl.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_sysctl.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_timer.h
===================================================================
--- trunk/sys/netinet/sctp_timer.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_timer.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_timer.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_uio.h
===================================================================
--- trunk/sys/netinet/sctp_uio.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_uio.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_uio.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctp_var.h
===================================================================
--- trunk/sys/netinet/sctp_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctp_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctp_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/sctputil.h
===================================================================
--- trunk/sys/netinet/sctputil.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/sctputil.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/sctputil.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/tcp.h
===================================================================
--- trunk/sys/netinet/tcp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet/tcp_debug.h
===================================================================
--- trunk/sys/netinet/tcp_debug.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_debug.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_debug.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/tcp_fsm.h
===================================================================
--- trunk/sys/netinet/tcp_fsm.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_fsm.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_fsm.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/tcp_hostcache.h
===================================================================
--- trunk/sys/netinet/tcp_hostcache.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_hostcache.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_hostcache.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet/tcp_lro.h
===================================================================
--- trunk/sys/netinet/tcp_lro.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_lro.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_lro.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4
\ No newline at end of property
Index: trunk/sys/netinet/tcp_offload.h
===================================================================
--- trunk/sys/netinet/tcp_offload.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_offload.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_offload.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: trunk/sys/netinet/tcp_seq.h
===================================================================
--- trunk/sys/netinet/tcp_seq.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_seq.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_seq.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet/tcp_syncache.h
===================================================================
--- trunk/sys/netinet/tcp_syncache.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_syncache.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_syncache.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/tcp_timer.h
===================================================================
--- trunk/sys/netinet/tcp_timer.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_timer.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_timer.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet/tcp_var.h
===================================================================
--- trunk/sys/netinet/tcp_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcp_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcp_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.8
\ No newline at end of property
Index: trunk/sys/netinet/tcpip.h
===================================================================
--- trunk/sys/netinet/tcpip.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/tcpip.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/tcpip.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet/toedev.h
===================================================================
--- trunk/sys/netinet/toedev.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/toedev.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/toedev.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: trunk/sys/netinet/udp.h
===================================================================
--- trunk/sys/netinet/udp.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/udp.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet/udp.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Modified: trunk/sys/netinet/udp_usrreq.c
===================================================================
--- trunk/sys/netinet/udp_usrreq.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/udp_usrreq.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -3,6 +3,7 @@
* The Regents of the University of California.
* Copyright (c) 2008 Robert N. M. Watson
* Copyright (c) 2010-2011 Juniper Networks, Inc.
+ * Copyright (c) 2014 Kevin Lo
* All rights reserved.
*
* Portions of this software were developed by Robert N. M. Watson under
@@ -84,6 +85,7 @@
#endif
#include <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <netinet/udplite.h>
#ifdef IPSEC
#include <netipsec/ipsec.h>
@@ -95,8 +97,9 @@
#include <security/mac/mac_framework.h>
/*
- * UDP protocol implementation.
+ * UDP and UDP-Lite protocols implementation.
* Per RFC 768, August, 1980.
+ * Per RFC 3828, July, 2004.
*/
/*
@@ -136,6 +139,8 @@
VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */
VNET_DEFINE(struct inpcbinfo, udbinfo);
+VNET_DEFINE(struct inpcbhead, ulitecb);
+VNET_DEFINE(struct inpcbinfo, ulitecbinfo);
static VNET_DEFINE(uma_zone_t, udpcb_zone);
#define V_udpcb_zone VNET(udpcb_zone)
@@ -181,6 +186,16 @@
return (0);
}
+static int
+udplite_inpcb_init(void *mem, int size, int flags)
+{
+ struct inpcb *inp;
+
+ inp = mem;
+ INP_LOCK_INIT(inp, "inp", "udpliteinp");
+ return (0);
+}
+
void
udp_init(void)
{
@@ -195,6 +210,15 @@
EVENTHANDLER_PRI_ANY);
}
+void
+udplite_init(void)
+{
+
+ in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE,
+ UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL,
+ UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE);
+}
+
/*
* Kernel module interface for updating udpstat. The argument is an index
* into udpstat treated as an array of u_long. While this encodes the
@@ -236,6 +260,13 @@
in_pcbinfo_destroy(&V_udbinfo);
uma_zdestroy(V_udpcb_zone);
}
+
+void
+udplite_destroy(void)
+{
+
+ in_pcbinfo_destroy(&V_ulitecbinfo);
+}
#endif
#ifdef INET
@@ -339,11 +370,14 @@
struct ifnet *ifp;
struct inpcb *inp;
int len;
+ struct inpcbinfo *pcbinfo;
struct ip save_ip;
struct sockaddr_in udp_in;
#ifdef IPFIREWALL_FORWARD
struct m_tag *fwd_tag;
#endif
+ int cscov_partial;
+ uint8_t pr;
ifp = m->m_pkthdr.rcvif;
UDPSTAT_INC(udps_ipackets);
@@ -363,7 +397,7 @@
*/
ip = mtod(m, struct ip *);
if (m->m_len < iphlen + sizeof(struct udphdr)) {
- if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) {
+ if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == NULL) {
UDPSTAT_INC(udps_hdrops);
return;
}
@@ -370,6 +404,8 @@
ip = mtod(m, struct ip *);
}
uh = (struct udphdr *)((caddr_t)ip + iphlen);
+ pr = ip->ip_p;
+ cscov_partial = (pr == IPPROTO_UDPLITE) ? 1 : 0;
/*
* Destination port of 0 is illegal, based on RFC768.
@@ -392,13 +428,18 @@
* reflect UDP length, drop.
*/
len = ntohs((u_short)uh->uh_ulen);
+ if (pr == IPPROTO_UDPLITE && len == 0) {
+ /* Zero means checksum over the complete packet. */
+ len = ip->ip_len;
+ cscov_partial = 0;
+ }
if (ip->ip_len != len) {
if (len > ip->ip_len || len < sizeof(struct udphdr)) {
UDPSTAT_INC(udps_badlen);
goto badunlocked;
}
- m_adj(m, len - ip->ip_len);
- /* ip->ip_len = len; */
+ if (pr == IPPROTO_UDP)
+ m_adj(m, len - ip->ip_len);
}
/*
@@ -416,13 +457,14 @@
if (uh->uh_sum) {
u_short uh_sum;
- if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
+ if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID) &&
+ !cscov_partial) {
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
uh_sum = m->m_pkthdr.csum_data;
else
uh_sum = in_pseudo(ip->ip_src.s_addr,
ip->ip_dst.s_addr, htonl((u_short)len +
- m->m_pkthdr.csum_data + IPPROTO_UDP));
+ m->m_pkthdr.csum_data + pr));
uh_sum ^= 0xffff;
} else {
char b[9];
@@ -429,7 +471,8 @@
bcopy(((struct ipovly *)ip)->ih_x1, b, 9);
bzero(((struct ipovly *)ip)->ih_x1, 9);
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
+ ((struct ipovly *)ip)->ih_len = (pr == IPPROTO_UDP) ?
+ uh->uh_ulen : htons(ip->ip_len);
uh_sum = in_cksum(m, len + sizeof (struct ip));
bcopy(b, ((struct ipovly *)ip)->ih_x1, 9);
}
@@ -441,14 +484,17 @@
} else
UDPSTAT_INC(udps_nosum);
+ pcbinfo = get_inpcbinfo(pr);
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
in_broadcast(ip->ip_dst, ifp)) {
struct inpcb *last;
+ struct inpcbhead *pcblist;
struct ip_moptions *imo;
- INP_INFO_RLOCK(&V_udbinfo);
+ INP_INFO_RLOCK(pcbinfo);
+ pcblist = get_pcblist(pr);
last = NULL;
- LIST_FOREACH(inp, &V_udb, inp_list) {
+ LIST_FOREACH(inp, pcblist, inp_list) {
if (inp->inp_lport != uh->uh_dport)
continue;
#ifdef INET6
@@ -534,12 +580,12 @@
UDPSTAT_INC(udps_noportbcast);
if (inp)
INP_RUNLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_INFO_RUNLOCK(pcbinfo);
goto badunlocked;
}
udp_append(last, ip, m, iphlen, &udp_in);
INP_RUNLOCK(last);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_INFO_RUNLOCK(pcbinfo);
return;
}
@@ -560,7 +606,7 @@
* Transparently forwarded. Pretend to be the destination.
* Already got one like this?
*/
- inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport,
+ inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport,
ip->ip_dst, uh->uh_dport, INPLOOKUP_RLOCKPCB, ifp, m);
if (!inp) {
/*
@@ -568,7 +614,7 @@
* Because we've rewritten the destination address,
* any hardware-generated hash is ignored.
*/
- inp = in_pcblookup(&V_udbinfo, ip->ip_src,
+ inp = in_pcblookup(pcbinfo, ip->ip_src,
uh->uh_sport, next_hop->sin_addr,
next_hop->sin_port ? htons(next_hop->sin_port) :
uh->uh_dport, INPLOOKUP_WILDCARD |
@@ -578,7 +624,7 @@
m_tag_delete(m, fwd_tag);
} else
#endif /* IPFIREWALL_FORWARD */
- inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport,
+ inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport,
ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD |
INPLOOKUP_RLOCKPCB, ifp, m);
if (inp == NULL) {
@@ -615,6 +661,17 @@
m_freem(m);
return;
}
+ if (cscov_partial) {
+ struct udpcb *up;
+
+ up = intoudpcb(inp);
+ if (up->u_rxcslen > len) {
+ INP_RUNLOCK(inp);
+ m_freem(m);
+ return;
+ }
+ }
+
udp_append(inp, ip, m, iphlen, &udp_in);
INP_RUNLOCK(inp);
return;
@@ -647,8 +704,9 @@
}
#ifdef INET
-void
-udp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
+static void
+udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip,
+ struct inpcbinfo *pcbinfo)
{
struct ip *ip = vip;
struct udphdr *uh;
@@ -677,7 +735,7 @@
return;
if (ip != NULL) {
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- inp = in_pcblookup(&V_udbinfo, faddr, uh->uh_dport,
+ inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport,
ip->ip_src, uh->uh_sport, INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
INP_RLOCK_ASSERT(inp);
@@ -687,9 +745,22 @@
INP_RUNLOCK(inp);
}
} else
- in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd],
+ in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd],
udp_notify);
}
+void
+udp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
+{
+
+ return (udp_common_ctlinput(cmd, sa, vip, &V_udbinfo));
+}
+
+void
+udplite_ctlinput(int cmd, struct sockaddr *sa, void *vip)
+{
+
+ return (udp_common_ctlinput(cmd, sa, vip, &V_ulitecbinfo));
+}
#endif /* INET */
static int
@@ -845,16 +916,16 @@
int
udp_ctloutput(struct socket *so, struct sockopt *sopt)
{
- int error = 0, optval;
struct inpcb *inp;
-#ifdef IPSEC_NAT_T
struct udpcb *up;
-#endif
+ int isudplite, error, optval;
+ error = 0;
+ isudplite = (so->so_proto->pr_protocol == IPPROTO_UDPLITE) ? 1 : 0;
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("%s: inp == NULL", __func__));
INP_WLOCK(inp);
- if (sopt->sopt_level != IPPROTO_UDP) {
+ if (sopt->sopt_level != so->so_proto->pr_protocol) {
#ifdef INET6
if (INP_CHECK_SOCKAF(so, AF_INET6)) {
INP_WUNLOCK(inp);
@@ -912,6 +983,34 @@
}
INP_WUNLOCK(inp);
break;
+ case UDPLITE_SEND_CSCOV:
+ case UDPLITE_RECV_CSCOV:
+ if (!isudplite) {
+ INP_WUNLOCK(inp);
+ error = ENOPROTOOPT;
+ break;
+ }
+ INP_WUNLOCK(inp);
+ error = sooptcopyin(sopt, &optval, sizeof(optval),
+ sizeof(optval));
+ if (error != 0)
+ break;
+ inp = sotoinpcb(so);
+ KASSERT(inp != NULL, ("%s: inp == NULL", __func__));
+ INP_WLOCK(inp);
+ up = intoudpcb(inp);
+ KASSERT(up != NULL, ("%s: up == NULL", __func__));
+ if (optval != 0 && optval < 8) {
+ INP_WUNLOCK(inp);
+ error = EINVAL;
+ break;
+ }
+ if (sopt->sopt_name == UDPLITE_SEND_CSCOV)
+ up->u_txcslen = optval;
+ else
+ up->u_rxcslen = optval;
+ INP_WUNLOCK(inp);
+ break;
default:
INP_WUNLOCK(inp);
error = ENOPROTOOPT;
@@ -929,6 +1028,22 @@
error = sooptcopyout(sopt, &optval, sizeof optval);
break;
#endif
+ case UDPLITE_SEND_CSCOV:
+ case UDPLITE_RECV_CSCOV:
+ if (!isudplite) {
+ INP_WUNLOCK(inp);
+ error = ENOPROTOOPT;
+ break;
+ }
+ up = intoudpcb(inp);
+ KASSERT(up != NULL, ("%s: up == NULL", __func__));
+ if (sopt->sopt_name == UDPLITE_SEND_CSCOV)
+ optval = up->u_txcslen;
+ else
+ optval = up->u_rxcslen;
+ INP_WUNLOCK(inp);
+ error = sooptcopyout(sopt, &optval, sizeof(optval));
+ break;
default:
INP_WUNLOCK(inp);
error = ENOPROTOOPT;
@@ -951,12 +1066,16 @@
int len = m->m_pkthdr.len;
struct in_addr faddr, laddr;
struct cmsghdr *cm;
+ struct inpcbinfo *pcbinfo;
struct sockaddr_in *sin, src;
+ int cscov_partial = 0;
int error = 0;
int ipflags;
u_short fport, lport;
int unlock_udbinfo;
u_char tos;
+ uint8_t pr;
+ uint16_t cscov = 0;
/*
* udp_output() may need to temporarily bind or connect the current
@@ -1051,12 +1170,14 @@
*
* XXXRW: Check that hash locking update here is correct.
*/
+ pr = inp->inp_socket->so_proto->pr_protocol;
+ pcbinfo = get_inpcbinfo(pr);
sin = (struct sockaddr_in *)addr;
if (sin != NULL &&
(inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) {
INP_RUNLOCK(inp);
INP_WLOCK(inp);
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
unlock_udbinfo = UH_WLOCKED;
} else if ((sin != NULL && (
(sin->sin_addr.s_addr == INADDR_ANY) ||
@@ -1064,7 +1185,7 @@
(inp->inp_laddr.s_addr == INADDR_ANY) ||
(inp->inp_lport == 0))) ||
(src.sin_family == AF_INET)) {
- INP_HASH_RLOCK(&V_udbinfo);
+ INP_HASH_RLOCK(pcbinfo);
unlock_udbinfo = UH_RLOCKED;
} else
unlock_udbinfo = UH_UNLOCKED;
@@ -1077,7 +1198,7 @@
laddr = inp->inp_laddr;
lport = inp->inp_lport;
if (src.sin_family == AF_INET) {
- INP_HASH_LOCK_ASSERT(&V_udbinfo);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
if ((lport == 0) ||
(laddr.s_addr == INADDR_ANY &&
src.sin_addr.s_addr == INADDR_ANY)) {
@@ -1128,7 +1249,7 @@
inp->inp_lport == 0 ||
sin->sin_addr.s_addr == INADDR_ANY ||
sin->sin_addr.s_addr == INADDR_BROADCAST) {
- INP_HASH_LOCK_ASSERT(&V_udbinfo);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
error = in_pcbconnect_setup(inp, addr, &laddr.s_addr,
&lport, &faddr.s_addr, &fport, NULL,
td->td_ucred);
@@ -1143,7 +1264,7 @@
if (inp->inp_laddr.s_addr == INADDR_ANY &&
inp->inp_lport == 0) {
INP_WLOCK_ASSERT(inp);
- INP_HASH_WLOCK_ASSERT(&V_udbinfo);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
/*
* Remember addr if jailed, to prevent
* rebinding.
@@ -1192,13 +1313,31 @@
*/
ui = mtod(m, struct udpiphdr *);
bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */
- ui->ui_pr = IPPROTO_UDP;
+ ui->ui_pr = pr;
ui->ui_src = laddr;
ui->ui_dst = faddr;
ui->ui_sport = lport;
ui->ui_dport = fport;
ui->ui_ulen = htons((u_short)len + sizeof(struct udphdr));
+ if (pr == IPPROTO_UDPLITE) {
+ struct udpcb *up;
+ uint16_t plen;
+ up = intoudpcb(inp);
+ cscov = up->u_txcslen;
+ plen = (u_short)len + sizeof(struct udphdr);
+ if (cscov >= plen)
+ cscov = 0;
+ ui->ui_len = htons(plen);
+ ui->ui_ulen = htons(cscov);
+ /*
+ * For UDP-Lite, checksum coverage length of zero means
+ * the entire UDPLite packet is covered by the checksum.
+ */
+ cscov_partial = (cscov == 0) ? 0 : 1;
+ } else
+/* TODO: where in the world ui->ui_v = IPVERSION << 4; */
+
/*
* Set the Don't Fragment bit in the IP header.
*/
@@ -1224,15 +1363,25 @@
/*
* Set up checksum and output datagram.
*/
- if (V_udp_cksum) {
+ ui->ui_sum = 0;
+ if (pr == IPPROTO_UDPLITE) {
if (inp->inp_flags & INP_ONESBCAST)
faddr.s_addr = INADDR_BROADCAST;
+ if (cscov_partial) {
+ if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0)
+ ui->ui_sum = 0xffff;
+ } else {
+ if ((ui->ui_sum = in_cksum(m, sizeof(struct udpiphdr) + len)) == 0)
+ ui->ui_sum = 0xffff;
+ }
+ } else if (V_udp_cksum) {
+ if (inp->inp_flags & INP_ONESBCAST)
+ faddr.s_addr = INADDR_BROADCAST;
ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr,
- htons((u_short)len + sizeof(struct udphdr) + IPPROTO_UDP));
+ htons((u_short)len + sizeof(struct udphdr) + pr));
m->m_pkthdr.csum_flags = CSUM_UDP;
m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
- } else
- ui->ui_sum = 0;
+ }
((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */
((struct ip *)ui)->ip_tos = tos; /* XXX */
@@ -1239,9 +1388,9 @@
UDPSTAT_INC(udps_opackets);
if (unlock_udbinfo == UH_WLOCKED)
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
else if (unlock_udbinfo == UH_RLOCKED)
- INP_HASH_RUNLOCK(&V_udbinfo);
+ INP_HASH_RUNLOCK(pcbinfo);
error = ip_output(m, inp->inp_options, NULL, ipflags,
inp->inp_moptions, inp);
if (unlock_udbinfo == UH_WLOCKED)
@@ -1252,10 +1401,10 @@
release:
if (unlock_udbinfo == UH_WLOCKED) {
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
INP_WUNLOCK(inp);
} else if (unlock_udbinfo == UH_RLOCKED) {
- INP_HASH_RUNLOCK(&V_udbinfo);
+ INP_HASH_RUNLOCK(pcbinfo);
INP_RUNLOCK(inp);
} else
INP_RUNLOCK(inp);
@@ -1402,15 +1551,17 @@
udp_abort(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_abort: inp == NULL"));
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr != INADDR_ANY) {
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
@@ -1420,17 +1571,19 @@
udp_attach(struct socket *so, int proto, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp == NULL, ("udp_attach: inp != NULL"));
error = soreserve(so, udp_sendspace, udp_recvspace);
if (error)
return (error);
- INP_INFO_WLOCK(&V_udbinfo);
- error = in_pcballoc(so, &V_udbinfo);
+ INP_INFO_WLOCK(pcbinfo);
+ error = in_pcballoc(so, pcbinfo);
if (error) {
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (error);
}
@@ -1442,12 +1595,12 @@
if (error) {
in_pcbdetach(inp);
in_pcbfree(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (error);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (0);
}
#endif /* INET */
@@ -1478,14 +1631,16 @@
udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_bind: inp == NULL"));
INP_WLOCK(inp);
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
error = in_pcbbind(inp, nam, td->td_ucred);
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
INP_WUNLOCK(inp);
return (error);
}
@@ -1494,15 +1649,17 @@
udp_close(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_close: inp == NULL"));
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr != INADDR_ANY) {
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
@@ -1512,9 +1669,11 @@
udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ struct sockaddr_in *sin;
int error;
- struct sockaddr_in *sin;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_connect: inp == NULL"));
INP_WLOCK(inp);
@@ -1528,9 +1687,9 @@
INP_WUNLOCK(inp);
return (error);
}
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
error = in_pcbconnect(inp, nam, td->td_ucred);
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
if (error == 0)
soisconnected(so);
INP_WUNLOCK(inp);
@@ -1541,13 +1700,15 @@
udp_detach(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
struct udpcb *up;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_detach: inp == NULL"));
KASSERT(inp->inp_faddr.s_addr == INADDR_ANY,
("udp_detach: not disconnected"));
- INP_INFO_WLOCK(&V_udbinfo);
+ INP_INFO_WLOCK(pcbinfo);
INP_WLOCK(inp);
up = intoudpcb(inp);
KASSERT(up != NULL, ("%s: up == NULL", __func__));
@@ -1554,7 +1715,7 @@
inp->inp_ppcb = NULL;
in_pcbdetach(inp);
in_pcbfree(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
udp_discardcb(up);
}
@@ -1562,7 +1723,9 @@
udp_disconnect(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_disconnect: inp == NULL"));
INP_WLOCK(inp);
@@ -1570,10 +1733,10 @@
INP_WUNLOCK(inp);
return (ENOTCONN);
}
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
SOCK_UNLOCK(so);
Modified: trunk/sys/netinet/udp_var.h
===================================================================
--- trunk/sys/netinet/udp_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet/udp_var.h 2014-11-16 20:36:05 UTC (rev 6952)
@@ -59,6 +59,8 @@
struct udpcb {
udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */
u_int u_flags; /* Generic UDP flags. */
+ uint16_t u_rxcslen; /* Coverage for incoming datagrams. */
+ uint16_t u_txcslen; /* Coverage for outgoing datagrams. */
};
#define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb)
@@ -131,8 +133,12 @@
extern struct pr_usrreqs udp_usrreqs;
VNET_DECLARE(struct inpcbhead, udb);
VNET_DECLARE(struct inpcbinfo, udbinfo);
+VNET_DECLARE(struct inpcbhead, ulitecb);
+VNET_DECLARE(struct inpcbinfo, ulitecbinfo);
#define V_udb VNET(udb)
#define V_udbinfo VNET(udbinfo)
+#define V_ulitecb VNET(ulitecb)
+#define V_ulitecbinfo VNET(ulitecbinfo)
extern u_long udp_sendspace;
extern u_long udp_recvspace;
@@ -144,20 +150,37 @@
#define V_udp_blackhole VNET(udp_blackhole)
extern int udp_log_in_vain;
-int udp_newudpcb(struct inpcb *);
-void udp_discardcb(struct udpcb *);
+static __inline struct inpcbinfo *
+get_inpcbinfo(uint8_t protocol)
+{
+ return (protocol == IPPROTO_UDP) ? &V_udbinfo : &V_ulitecbinfo;
+}
-void udp_ctlinput(int, struct sockaddr *, void *);
-int udp_ctloutput(struct socket *, struct sockopt *);
-void udp_init(void);
+static __inline struct inpcbhead *
+get_pcblist(uint8_t protocol)
+{
+ return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb;
+}
+
+int udp_newudpcb(struct inpcb *);
+void udp_discardcb(struct udpcb *);
+
+void udp_ctlinput(int, struct sockaddr *, void *);
+void udplite_ctlinput(int, struct sockaddr *, void *);
+int udp_ctloutput(struct socket *, struct sockopt *);
+void udp_init(void);
+void udplite_init(void);
#ifdef VIMAGE
-void udp_destroy(void);
+void udp_destroy(void);
+void udplite_destroy(void);
#endif
-void udp_input(struct mbuf *, int);
+void udp_input(struct mbuf *, int);
+void udplite_input(struct mbuf *, int);
struct inpcb *udp_notify(struct inpcb *inp, int errno);
-int udp_shutdown(struct socket *so);
+int udp_shutdown(struct socket *so);
-int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f);
-#endif
+int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f);
-#endif
+#endif /* _KERNEL */
+
+#endif /* _NETINET_UDP_VAR_H_ */
Property changes on: trunk/sys/netinet/udp_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/dest6.c
===================================================================
--- trunk/sys/netinet6/dest6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/dest6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/dest6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/frag6.c
===================================================================
--- trunk/sys/netinet6/frag6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/frag6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/frag6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/icmp6.c
===================================================================
--- trunk/sys/netinet6/icmp6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/icmp6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/icmp6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.8
\ No newline at end of property
Index: trunk/sys/netinet6/icmp6.h
===================================================================
--- trunk/sys/netinet6/icmp6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/icmp6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/icmp6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/in6.c
===================================================================
--- trunk/sys/netinet6/in6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.10
\ No newline at end of property
Index: trunk/sys/netinet6/in6.h
===================================================================
--- trunk/sys/netinet6/in6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.10
\ No newline at end of property
Index: trunk/sys/netinet6/in6_cksum.c
===================================================================
--- trunk/sys/netinet6/in6_cksum.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_cksum.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_cksum.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_gif.c
===================================================================
--- trunk/sys/netinet6/in6_gif.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_gif.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_gif.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_gif.h
===================================================================
--- trunk/sys/netinet6/in6_gif.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_gif.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_gif.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Modified: trunk/sys/netinet6/in6_ifattach.c
===================================================================
--- trunk/sys/netinet6/in6_ifattach.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_ifattach.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -838,6 +838,7 @@
}
in6_pcbpurgeif0(&V_udbinfo, ifp);
+ in6_pcbpurgeif0(&V_ulitecbinfo, ifp);
in6_pcbpurgeif0(&V_ripcbinfo, ifp);
/* leave from all multicast groups joined */
in6_purgemaddrs(ifp);
Property changes on: trunk/sys/netinet6/in6_ifattach.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_ifattach.h
===================================================================
--- trunk/sys/netinet6/in6_ifattach.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_ifattach.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_ifattach.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_mcast.c
===================================================================
--- trunk/sys/netinet6/in6_mcast.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_mcast.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_mcast.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: trunk/sys/netinet6/in6_pcb.c
===================================================================
--- trunk/sys/netinet6/in6_pcb.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_pcb.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_pcb.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_pcb.h
===================================================================
--- trunk/sys/netinet6/in6_pcb.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_pcb.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_pcb.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_pcbgroup.c
===================================================================
--- trunk/sys/netinet6/in6_pcbgroup.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_pcbgroup.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_pcbgroup.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Modified: trunk/sys/netinet6/in6_proto.c
===================================================================
--- trunk/sys/netinet6/in6_proto.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_proto.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -211,7 +211,7 @@
.pr_protocol = IPPROTO_SCTP,
.pr_flags = PR_WANTRCVD,
.pr_input = sctp6_input,
- .pr_ctlinput = sctp6_ctlinput,
+ .pr_ctlinput = sctp6_ctlinput,
.pr_ctloutput = sctp_ctloutput,
.pr_drain = sctp_drain,
.pr_usrreqs = &sctp6_usrreqs
@@ -218,6 +218,19 @@
},
#endif /* SCTP */
{
+ .pr_type = SOCK_DGRAM,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_UDPLITE,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = udp6_input,
+ .pr_ctlinput = udplite6_ctlinput,
+ .pr_ctloutput = udp_ctloutput,
+#ifndef INET /* Do not call initialization twice. */
+ .pr_init = udplite_init,
+#endif
+ .pr_usrreqs = &udp6_usrreqs,
+},
+{
.pr_type = SOCK_RAW,
.pr_domain = &inet6domain,
.pr_protocol = IPPROTO_RAW,
Property changes on: trunk/sys/netinet6/in6_proto.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.9
\ No newline at end of property
Index: trunk/sys/netinet6/in6_rmx.c
===================================================================
--- trunk/sys/netinet6/in6_rmx.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_rmx.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_rmx.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_src.c
===================================================================
--- trunk/sys/netinet6/in6_src.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_src.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_src.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/in6_var.h
===================================================================
--- trunk/sys/netinet6/in6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/in6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/in6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6.h
===================================================================
--- trunk/sys/netinet6/ip6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_ecn.h
===================================================================
--- trunk/sys/netinet6/ip6_ecn.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_ecn.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_ecn.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_forward.c
===================================================================
--- trunk/sys/netinet6/ip6_forward.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_forward.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_forward.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_id.c
===================================================================
--- trunk/sys/netinet6/ip6_id.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_id.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_id.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_input.c
===================================================================
--- trunk/sys/netinet6/ip6_input.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_input.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_input.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_ipsec.c
===================================================================
--- trunk/sys/netinet6/ip6_ipsec.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_ipsec.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_ipsec.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_ipsec.h
===================================================================
--- trunk/sys/netinet6/ip6_ipsec.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_ipsec.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_ipsec.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_mroute.c
===================================================================
--- trunk/sys/netinet6/ip6_mroute.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_mroute.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_mroute.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_mroute.h
===================================================================
--- trunk/sys/netinet6/ip6_mroute.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_mroute.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_mroute.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_output.c
===================================================================
--- trunk/sys/netinet6/ip6_output.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_output.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_output.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/ip6_var.h
===================================================================
--- trunk/sys/netinet6/ip6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/ip6protosw.h
===================================================================
--- trunk/sys/netinet6/ip6protosw.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/ip6protosw.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/ip6protosw.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/mld6.c
===================================================================
--- trunk/sys/netinet6/mld6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/mld6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/mld6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/mld6.h
===================================================================
--- trunk/sys/netinet6/mld6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/mld6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/mld6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet6/mld6_var.h
===================================================================
--- trunk/sys/netinet6/mld6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/mld6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/mld6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/nd6.c
===================================================================
--- trunk/sys/netinet6/nd6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/nd6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/nd6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.8
\ No newline at end of property
Index: trunk/sys/netinet6/nd6.h
===================================================================
--- trunk/sys/netinet6/nd6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/nd6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/nd6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/nd6_nbr.c
===================================================================
--- trunk/sys/netinet6/nd6_nbr.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/nd6_nbr.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/nd6_nbr.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/nd6_rtr.c
===================================================================
--- trunk/sys/netinet6/nd6_rtr.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/nd6_rtr.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/nd6_rtr.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/pim6.h
===================================================================
--- trunk/sys/netinet6/pim6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/pim6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/pim6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/pim6_var.h
===================================================================
--- trunk/sys/netinet6/pim6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/pim6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/pim6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/raw_ip6.c
===================================================================
--- trunk/sys/netinet6/raw_ip6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/raw_ip6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/raw_ip6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/raw_ip6.h
===================================================================
--- trunk/sys/netinet6/raw_ip6.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/raw_ip6.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/raw_ip6.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/route6.c
===================================================================
--- trunk/sys/netinet6/route6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/route6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/route6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Index: trunk/sys/netinet6/scope6.c
===================================================================
--- trunk/sys/netinet6/scope6.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/scope6.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/scope6.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/scope6_var.h
===================================================================
--- trunk/sys/netinet6/scope6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/scope6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/scope6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Index: trunk/sys/netinet6/sctp6_usrreq.c
===================================================================
--- trunk/sys/netinet6/sctp6_usrreq.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/sctp6_usrreq.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/sctp6_usrreq.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/sctp6_var.h
===================================================================
--- trunk/sys/netinet6/sctp6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/sctp6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/sctp6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: trunk/sys/netinet6/send.c
===================================================================
--- trunk/sys/netinet6/send.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/send.c 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/send.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet6/send.h
===================================================================
--- trunk/sys/netinet6/send.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/send.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/send.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: trunk/sys/netinet6/tcp6_var.h
===================================================================
--- trunk/sys/netinet6/tcp6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/tcp6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
Property changes on: trunk/sys/netinet6/tcp6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Modified: trunk/sys/netinet6/udp6_usrreq.c
===================================================================
--- trunk/sys/netinet6/udp6_usrreq.c 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/udp6_usrreq.c 2014-11-16 20:36:05 UTC (rev 6952)
@@ -1,6 +1,7 @@
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* Copyright (c) 2010-2011 Juniper Networks, Inc.
+ * Copyright (c) 2014 Kevin Lo
* All rights reserved.
*
* Portions of this software were developed by Robert N. M. Watson under
@@ -106,6 +107,7 @@
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <netinet/udplite.h>
#include <netinet6/ip6protosw.h>
#include <netinet6/ip6_var.h>
@@ -178,8 +180,10 @@
struct ip6_hdr *ip6;
struct udphdr *uh;
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
struct udpcb *up;
int off = *offp;
+ int cscov_partial;
int plen, ulen;
struct sockaddr_in6 fromsa;
#ifdef IPFIREWALL_FORWARD
@@ -186,6 +190,7 @@
struct m_tag *fwd_tag;
#endif
uint16_t uh_sum;
+ uint8_t nxt;
ifp = m->m_pkthdr.rcvif;
ip6 = mtod(m, struct ip6_hdr *);
@@ -217,6 +222,13 @@
plen = ntohs(ip6->ip6_plen) - off + sizeof(*ip6);
ulen = ntohs((u_short)uh->uh_ulen);
+ nxt = ip6->ip6_nxt;
+ cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0;
+ if (nxt == IPPROTO_UDPLITE && ulen == 0) {
+ /* Zero means checksum over the complete packet. */
+ ulen = plen;
+ cscov_partial = 0;
+ }
if (plen != ulen) {
UDPSTAT_INC(udps_badlen);
goto badunlocked;
@@ -226,19 +238,22 @@
* Checksum extended UDP header and data.
*/
if (uh->uh_sum == 0) {
- UDPSTAT_INC(udps_nosum);
- goto badunlocked;
+ if (ulen > plen || ulen < sizeof(struct udphdr)) {
+ UDPSTAT_INC(udps_nosum);
+ goto badunlocked;
+ }
}
- if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) {
+ if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) &&
+ !cscov_partial) {
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
uh_sum = m->m_pkthdr.csum_data;
else
- uh_sum = in6_cksum_pseudo(ip6, ulen,
- IPPROTO_UDP, m->m_pkthdr.csum_data);
+ uh_sum = in6_cksum_pseudo(ip6, ulen, nxt,
+ m->m_pkthdr.csum_data);
uh_sum ^= 0xffff;
} else
- uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen);
+ uh_sum = in6_cksum(m, nxt, off, ulen);
if (uh_sum != 0) {
UDPSTAT_INC(udps_badsum);
@@ -251,11 +266,13 @@
init_sin6(&fromsa, m);
fromsa.sin6_port = uh->uh_sport;
+ pcbinfo = get_inpcbinfo(nxt);
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
struct inpcb *last;
+ struct inpcbhead *pcblist;
struct ip6_moptions *imo;
- INP_INFO_RLOCK(&V_udbinfo);
+ INP_INFO_RLOCK(pcbinfo);
/*
* In the event that laddr should be set to the link-local
* address (this happens in RIPng), the multicast address
@@ -271,8 +288,9 @@
* here. We need udphdr for IPsec processing so we do that
* later.
*/
+ pcblist = get_pcblist(nxt);
last = NULL;
- LIST_FOREACH(inp, &V_udb, inp_list) {
+ LIST_FOREACH(inp, pcblist, inp_list) {
if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
if (inp->inp_lport != uh->uh_dport)
@@ -377,7 +395,7 @@
goto badheadlocked;
}
INP_RLOCK(last);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_INFO_RUNLOCK(pcbinfo);
up = intoudpcb(last);
if (up->u_tun_func == NULL) {
udp6_append(last, m, off, &fromsa);
@@ -407,8 +425,8 @@
* Transparently forwarded. Pretend to be the destination.
* Already got one like this?
*/
- inp = in6_pcblookup_mbuf(&V_udbinfo,
- &ip6->ip6_src, uh->uh_sport, &ip6->ip6_dst, uh->uh_dport,
+ inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_src,
+ uh->uh_sport, &ip6->ip6_dst, uh->uh_dport,
INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif, m);
if (!inp) {
/*
@@ -416,7 +434,7 @@
* Because we've rewritten the destination address,
* any hardware-generated hash is ignored.
*/
- inp = in6_pcblookup(&V_udbinfo, &ip6->ip6_src,
+ inp = in6_pcblookup(pcbinfo, &ip6->ip6_src,
uh->uh_sport, &next_hop6->sin6_addr,
next_hop6->sin6_port ? htons(next_hop6->sin6_port) :
uh->uh_dport, INPLOOKUP_WILDCARD |
@@ -426,7 +444,7 @@
m_tag_delete(m, fwd_tag);
} else
#endif /* IPFIREWALL_FORWARD */
- inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src,
+ inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_src,
uh->uh_sport, &ip6->ip6_dst, uh->uh_dport,
INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB,
m->m_pkthdr.rcvif, m);
@@ -457,6 +475,13 @@
}
INP_RLOCK_ASSERT(inp);
up = intoudpcb(inp);
+ if (cscov_partial) {
+ if (up->u_rxcslen > ulen) {
+ INP_RUNLOCK(inp);
+ m_freem(m);
+ return (IPPROTO_DONE);
+ }
+ }
if (up->u_tun_func == NULL) {
udp6_append(inp, m, off, &fromsa);
} else {
@@ -470,7 +495,7 @@
return (IPPROTO_DONE);
badheadlocked:
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_INFO_RUNLOCK(pcbinfo);
badunlocked:
if (m)
m_freem(m);
@@ -477,8 +502,9 @@
return (IPPROTO_DONE);
}
-void
-udp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
+static void
+udp6_common_ctlinput(int cmd, struct sockaddr *sa, void *d,
+ struct inpcbinfo *pcbinfo)
{
struct udphdr uh;
struct ip6_hdr *ip6;
@@ -534,14 +560,28 @@
bzero(&uh, sizeof(uh));
m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh);
- (void) in6_pcbnotify(&V_udbinfo, sa, uh.uh_dport,
+ (void)in6_pcbnotify(pcbinfo, sa, uh.uh_dport,
(struct sockaddr *)ip6cp->ip6c_src, uh.uh_sport, cmd,
cmdarg, notify);
} else
- (void) in6_pcbnotify(&V_udbinfo, sa, 0,
+ (void)in6_pcbnotify(pcbinfo, sa, 0,
(const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify);
}
+void
+udp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
+{
+
+ return (udp6_common_ctlinput(cmd, sa, d, &V_udbinfo));
+}
+
+void
+udplite6_ctlinput(int cmd, struct sockaddr *sa, void *d)
+{
+
+ return (udp6_common_ctlinput(cmd, sa, d, &V_ulitecbinfo));
+}
+
static int
udp6_getcred(SYSCTL_HANDLER_ARGS)
{
@@ -599,9 +639,12 @@
struct in6_addr *laddr, *faddr, in6a;
struct sockaddr_in6 *sin6 = NULL;
struct ifnet *oifp = NULL;
+ int cscov_partial = 0;
int scope_ambiguous = 0;
u_short fport;
int error = 0;
+ uint8_t nxt;
+ uint16_t cscov = 0;
struct ip6_pktopts *optp, opt;
int af = AF_INET6, hlen = sizeof(struct ip6_hdr);
int flags;
@@ -760,10 +803,25 @@
/*
* Stuff checksum and output datagram.
*/
+ nxt = (inp->inp_socket->so_proto->pr_protocol == IPPROTO_UDP) ?
+ IPPROTO_UDP : IPPROTO_UDPLITE;
udp6 = (struct udphdr *)(mtod(m, caddr_t) + hlen);
udp6->uh_sport = inp->inp_lport; /* lport is always set in the PCB */
udp6->uh_dport = fport;
- if (plen <= 0xffff)
+ if (nxt == IPPROTO_UDPLITE) {
+ struct udpcb *up;
+
+ up = intoudpcb(inp);
+ cscov = up->u_txcslen;
+ if (cscov >= plen)
+ cscov = 0;
+ udp6->uh_ulen = htons(cscov);
+ /*
+ * For UDP-Lite, checksum coverage length of zero means
+ * the entire UDPLite packet is covered by the checksum.
+ */
+ cscov_partial = (cscov == 0) ? 0 : 1;
+ } else if (plen <= 0xffff)
udp6->uh_ulen = htons((u_short)plen);
else
udp6->uh_ulen = 0;
@@ -778,14 +836,20 @@
#if 0 /* ip6_plen will be filled in ip6_output. */
ip6->ip6_plen = htons((u_short)plen);
#endif
- ip6->ip6_nxt = IPPROTO_UDP;
+ ip6->ip6_nxt = nxt;
ip6->ip6_hlim = in6_selecthlim(inp, NULL);
ip6->ip6_src = *laddr;
ip6->ip6_dst = *faddr;
- udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0);
- m->m_pkthdr.csum_flags = CSUM_UDP_IPV6;
- m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
+ if (cscov_partial) {
+ if ((udp6->uh_sum = in6_cksum(m, 0,
+ sizeof(struct ip6_hdr), cscov)) == 0)
+ udp6->uh_sum = 0xffff;
+ } else {
+ udp6->uh_sum = in6_cksum_pseudo(ip6, plen, nxt, 0);
+ m->m_pkthdr.csum_flags = CSUM_UDP_IPV6;
+ m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
+ }
flags = 0;
@@ -814,7 +878,9 @@
udp6_abort(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_abort: inp == NULL"));
@@ -830,10 +896,10 @@
INP_WLOCK(inp);
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
@@ -843,8 +909,10 @@
udp6_attach(struct socket *so, int proto, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp == NULL, ("udp6_attach: inp != NULL"));
@@ -853,10 +921,10 @@
if (error)
return (error);
}
- INP_INFO_WLOCK(&V_udbinfo);
- error = in_pcballoc(so, &V_udbinfo);
+ INP_INFO_WLOCK(pcbinfo);
+ error = in_pcballoc(so, pcbinfo);
if (error) {
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (error);
}
inp = (struct inpcb *)so->so_pcb;
@@ -877,11 +945,11 @@
if (error) {
in_pcbdetach(inp);
in_pcbfree(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (error);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
return (0);
}
@@ -889,13 +957,15 @@
udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_bind: inp == NULL"));
INP_WLOCK(inp);
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
@@ -923,7 +993,7 @@
#ifdef INET
out:
#endif
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
INP_WUNLOCK(inp);
return (error);
}
@@ -932,7 +1002,9 @@
udp6_close(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_close: inp == NULL"));
@@ -947,10 +1019,10 @@
#endif
INP_WLOCK(inp);
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
@@ -960,9 +1032,11 @@
udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
struct sockaddr_in6 *sin6;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
sin6 = (struct sockaddr_in6 *)nam;
KASSERT(inp != NULL, ("udp6_connect: inp == NULL"));
@@ -989,10 +1063,10 @@
error = prison_remote_ip4(td->td_ucred, &sin.sin_addr);
if (error != 0)
goto out;
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
error = in_pcbconnect(inp, (struct sockaddr *)&sin,
td->td_ucred);
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
if (error == 0)
soisconnected(so);
goto out;
@@ -1007,9 +1081,9 @@
error = prison_remote_ip6(td->td_ucred, &sin6->sin6_addr);
if (error != 0)
goto out;
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
error = in6_pcbconnect(inp, nam, td->td_ucred);
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
if (error == 0)
soisconnected(so);
out:
@@ -1021,18 +1095,20 @@
udp6_detach(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
struct udpcb *up;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_detach: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
+ INP_INFO_WLOCK(pcbinfo);
INP_WLOCK(inp);
up = intoudpcb(inp);
KASSERT(up != NULL, ("%s: up == NULL", __func__));
in_pcbdetach(inp);
in_pcbfree(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
+ INP_INFO_WUNLOCK(pcbinfo);
udp_discardcb(up);
}
@@ -1040,8 +1116,10 @@
udp6_disconnect(struct socket *so)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_disconnect: inp == NULL"));
@@ -1062,10 +1140,10 @@
goto out;
}
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
SOCK_UNLOCK(so);
@@ -1079,8 +1157,10 @@
struct sockaddr *addr, struct mbuf *control, struct thread *td)
{
struct inpcb *inp;
+ struct inpcbinfo *pcbinfo;
int error = 0;
+ pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_send: inp == NULL"));
@@ -1132,9 +1212,9 @@
#ifdef MAC
mac_inpcb_create_mbuf(inp, m);
#endif
- INP_HASH_WLOCK(&V_udbinfo);
+ INP_HASH_WLOCK(pcbinfo);
error = udp6_output(inp, m, addr, control, td);
- INP_HASH_WUNLOCK(&V_udbinfo);
+ INP_HASH_WUNLOCK(pcbinfo);
#ifdef INET
#endif
INP_WUNLOCK(inp);
Property changes on: trunk/sys/netinet6/udp6_usrreq.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
Modified: trunk/sys/netinet6/udp6_var.h
===================================================================
--- trunk/sys/netinet6/udp6_var.h 2014-11-16 18:34:35 UTC (rev 6951)
+++ trunk/sys/netinet6/udp6_var.h 2014-11-16 20:36:05 UTC (rev 6952)
@@ -69,6 +69,7 @@
extern struct pr_usrreqs udp6_usrreqs;
void udp6_ctlinput(int, struct sockaddr *, void *);
+void udplite6_ctlinput(int, struct sockaddr *, void *);
int udp6_input(struct mbuf **, int *, int);
#endif
Property changes on: trunk/sys/netinet6/udp6_var.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.6
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list