#include <net/if.h>
#include <net/route.h>
+#include <net/kpi_protocol.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
.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,
.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,
.pr_usrreqs = &rip_usrreqs,
.pr_unlock = rip_unlock,
},
-#if MROUTING
-{
- .pr_type = SOCK_RAW,
- .pr_protocol = IPPROTO_RSVP,
- .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
- .pr_input = rsvp_input,
- .pr_ctloutput = rip_ctloutput,
- .pr_usrreqs = &rip_usrreqs,
- .pr_unlock = rip_unlock,
-},
-#endif /* MROUTING */
{
.pr_type = SOCK_RAW,
.pr_protocol = IPPROTO_GRE,
inetdomain = dp;
+ /*
+ * Verify that the maximum possible tcp/ip header will still
+ * fit in a small mbuf because m_pullup only puls into 256
+ * byte mbuf
+ */
+ _CASSERT((sizeof(struct tcpiphdr) + TCP_MAXOLEN) <= _MHLEN);
+
/*
* Attach first, then initialize; ip_init() needs raw IP handler.
*/
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);
}
}