2344 uint_t ip_hdr_length;
2345 uint_t min_ulp_header_length;
2346 int offset;
2347 ssize_t len;
2348 netstack_t *ns = ipst->ips_netstack;
2349 ipsec_stack_t *ipss = ns->netstack_ipsec;
2350 ill_t *rill = ira->ira_rill;
2351
2352 ASSERT(ira->ira_pktlen == ntohs(ipha->ipha_length));
2353
2354 ip_hdr_length = ira->ira_ip_hdr_length;
2355 ira->ira_protocol = protocol;
2356
2357 /*
2358 * Time for IPP once we've done reassembly and IPsec.
2359 * We skip this for loopback packets since we don't do IPQoS
2360 * on loopback.
2361 */
2362 if (IPP_ENABLED(IPP_LOCAL_IN, ipst) &&
2363 !(iraflags & IRAF_LOOPBACK) &&
2364 (protocol != IPPROTO_ESP || protocol != IPPROTO_AH)) {
2365 /*
2366 * Use the interface on which the packet arrived - not where
2367 * the IP address is hosted.
2368 */
2369 /* ip_process translates an IS_UNDER_IPMP */
2370 mp = ip_process(IPP_LOCAL_IN, mp, rill, ill);
2371 if (mp == NULL) {
2372 /* ip_drop_packet and MIB done */
2373 return;
2374 }
2375 }
2376
2377 /* Determine the minimum required size of the upper-layer header */
2378 /* Need to do this for at least the set of ULPs that TX handles. */
2379 switch (protocol) {
2380 case IPPROTO_TCP:
2381 min_ulp_header_length = TCP_MIN_HEADER_LENGTH;
2382 break;
2383 case IPPROTO_SCTP:
2384 min_ulp_header_length = SCTP_COMMON_HDR_LENGTH;
|
2344 uint_t ip_hdr_length;
2345 uint_t min_ulp_header_length;
2346 int offset;
2347 ssize_t len;
2348 netstack_t *ns = ipst->ips_netstack;
2349 ipsec_stack_t *ipss = ns->netstack_ipsec;
2350 ill_t *rill = ira->ira_rill;
2351
2352 ASSERT(ira->ira_pktlen == ntohs(ipha->ipha_length));
2353
2354 ip_hdr_length = ira->ira_ip_hdr_length;
2355 ira->ira_protocol = protocol;
2356
2357 /*
2358 * Time for IPP once we've done reassembly and IPsec.
2359 * We skip this for loopback packets since we don't do IPQoS
2360 * on loopback.
2361 */
2362 if (IPP_ENABLED(IPP_LOCAL_IN, ipst) &&
2363 !(iraflags & IRAF_LOOPBACK) &&
2364 (protocol != IPPROTO_ESP && protocol != IPPROTO_AH)) {
2365 /*
2366 * Use the interface on which the packet arrived - not where
2367 * the IP address is hosted.
2368 */
2369 /* ip_process translates an IS_UNDER_IPMP */
2370 mp = ip_process(IPP_LOCAL_IN, mp, rill, ill);
2371 if (mp == NULL) {
2372 /* ip_drop_packet and MIB done */
2373 return;
2374 }
2375 }
2376
2377 /* Determine the minimum required size of the upper-layer header */
2378 /* Need to do this for at least the set of ULPs that TX handles. */
2379 switch (protocol) {
2380 case IPPROTO_TCP:
2381 min_ulp_header_length = TCP_MIN_HEADER_LENGTH;
2382 break;
2383 case IPPROTO_SCTP:
2384 min_ulp_header_length = SCTP_COMMON_HDR_LENGTH;
|