]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/in_proto.c
xnu-3247.1.106.tar.gz
[apple/xnu.git] / bsd / netinet / in_proto.c
index 321e7819ec721932fe7c643abba202e0e206e62c..bb0fee86485f050f1dda4824850a2e295a32c33d 100644 (file)
@@ -129,7 +129,7 @@ static struct protosw inetsw[] = {
        .pr_type =              SOCK_DGRAM,
        .pr_protocol =          IPPROTO_UDP,
        .pr_flags =             PR_ATOMIC|PR_ADDR|PR_PROTOLOCK|PR_PCBLOCK|
-                               PR_EVCONNINFO,
+                               PR_EVCONNINFO|PR_PRECONN_WRITE,
        .pr_input =             udp_input,
        .pr_ctlinput =          udp_ctlinput,
        .pr_ctloutput =         udp_ctloutput,
@@ -143,7 +143,8 @@ static struct protosw inetsw[] = {
        .pr_type =              SOCK_STREAM,
        .pr_protocol =          IPPROTO_TCP,
        .pr_flags =             PR_CONNREQUIRED|PR_WANTRCVD|PR_PCBLOCK|
-                               PR_PROTOLOCK|PR_DISPOSE|PR_EVCONNINFO,
+                               PR_PROTOLOCK|PR_DISPOSE|PR_EVCONNINFO|
+                               PR_PRECONN_WRITE|PR_DATA_IDEMPOTENT,
        .pr_input =             tcp_input,
        .pr_ctlinput =          tcp_ctlinput,
        .pr_ctloutput =         tcp_ctloutput,
@@ -325,15 +326,15 @@ static void
 ip_proto_input(protocol_family_t protocol, mbuf_t packet_list)
 {
 #pragma unused(protocol)
-       mbuf_t  packet;
-       int how_many = 0 ;
 
-       /* ip_input should handle a list of packets but does not yet */
-       for (packet = packet_list; packet; packet = packet_list) {
-               how_many++;
-               packet_list = mbuf_nextpkt(packet);
-               mbuf_setnextpkt(packet, NULL);
-               ip_input(packet);
+       if (packet_list->m_nextpkt != NULL) {
+               ip_input_process_list(packet_list);
+       } else {
+               /*
+                * XXX remove this path if ip_input_process_list is proven
+                * to be stable and has minimum overhead on most platforms.
+                */
+               ip_input(packet_list);
        }
 }