Print this page
%B

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip_input.c
          +++ new/usr/src/uts/common/inet/ip/ip_input.c
↓ open down ↓ 108 lines elided ↑ open up ↑
 109  109  
 110  110  #include <ipp/ipp.h>
 111  111  #include <ipp/ipp_impl.h>
 112  112  #include <ipp/ipgpc/ipgpc.h>
 113  113  
 114  114  #include <sys/pattr.h>
 115  115  #include <inet/ipclassifier.h>
 116  116  #include <inet/sctp_ip.h>
 117  117  #include <inet/sctp/sctp_impl.h>
 118  118  #include <inet/udp_impl.h>
      119 +#include <inet/dccp/dccp_impl.h>
 119  120  #include <sys/sunddi.h>
 120  121  
 121  122  #include <sys/tsol/label.h>
 122  123  #include <sys/tsol/tnet.h>
 123  124  
 124  125  #include <sys/clock_impl.h>     /* For LBOLT_FASTPATH{,64} */
 125  126  
 126  127  #ifdef  DEBUG
 127  128  extern boolean_t skip_sctp_cksum;
 128  129  #endif
↓ open down ↓ 2253 lines elided ↑ open up ↑
2382 2383                  break;
2383 2384          case IPPROTO_SCTP:
2384 2385                  min_ulp_header_length = SCTP_COMMON_HDR_LENGTH;
2385 2386                  break;
2386 2387          case IPPROTO_UDP:
2387 2388                  min_ulp_header_length = UDPH_SIZE;
2388 2389                  break;
2389 2390          case IPPROTO_ICMP:
2390 2391                  min_ulp_header_length = ICMPH_SIZE;
2391 2392                  break;
     2393 +        case IPPROTO_DCCP:
     2394 +                min_ulp_header_length = DCCP_MIN_HEADER_LENGTH;
     2395 +                break;
2392 2396          default:
2393 2397                  min_ulp_header_length = 0;
2394 2398                  break;
2395 2399          }
2396 2400          /* Make sure we have the min ULP header length */
2397 2401          len = mp->b_wptr - rptr;
2398 2402          if (len < ip_hdr_length + min_ulp_header_length) {
2399 2403                  if (ira->ira_pktlen < ip_hdr_length + min_ulp_header_length) {
2400 2404                          BUMP_MIB(ill->ill_ip_mib, ipIfStatsInTruncatedPkts);
2401 2405                          ip_drop_input("ipIfStatsInTruncatedPkts", mp, ill);
↓ open down ↓ 305 lines elided ↑ open up ↑
2707 2711                  }
2708 2712                  /* Found a client; up it goes */
2709 2713                  IP_STAT(ipst, ip_udp_fannorm);
2710 2714                  BUMP_MIB(ill->ill_ip_mib, ipIfStatsHCInDelivers);
2711 2715                  ira->ira_ill = ira->ira_rill = NULL;
2712 2716                  (connp->conn_recv)(connp, mp, NULL, ira);
2713 2717                  CONN_DEC_REF(connp);
2714 2718                  ira->ira_ill = ill;
2715 2719                  ira->ira_rill = rill;
2716 2720                  return;
     2721 +        case IPPROTO_DCCP:
     2722 +                /* For DCCP, discard broadcast and multicast packets */
     2723 +                if (iraflags & IRAF_MULTIBROADCAST) {
     2724 +                        goto discard;
     2725 +                }
     2726 +
     2727 +                /* Checked above */
     2728 +                ASSERT(len >= ip_hdr_length + DCCP_MIN_HEADER_LENGTH);
     2729 +
     2730 +                /* Squeue hint */
     2731 +                if (ira->ira_sqp == NULL) {
     2732 +                        ira->ira_sqp = ip_squeue_get(ira->ira_ring);
     2733 +                }
     2734 +
     2735 +                connp = ipcl_classify_v4(mp, IPPROTO_DCCP, ip_hdr_length,
     2736 +                    ira, ipst);
     2737 +                if (connp == NULL) {
     2738 +                        cmn_err(CE_NOTE, "ip_input.c: ip_fanout_v4 connp not found");
     2739 +                        BUMP_MIB(ill->ill_ip_mib, ipIfStatsHCInDelivers);
     2740 +                        dccp_xmit_listeners_reset(mp, ira, ipst, NULL);
     2741 +                        return;
     2742 +                }
     2743 +
     2744 +                if (connp->conn_incoming_ifindex != 0 &&
     2745 +                    connp->conn_incoming_ifindex != ira->ira_ruifindex) {
     2746 +                        cmn_err(CE_NOTE, "ip_input.c: ip_fanout_v4 ifindex problem");
     2747 +                        BUMP_MIB(ill->ill_ip_mib, ipIfStatsHCInDelivers);
     2748 +                        dccp_xmit_listeners_reset(mp, ira, ipst, NULL);
     2749 +                        return;
     2750 +                }
     2751 +
     2752 +                if (CONN_INBOUND_POLICY_PRESENT(connp, ipss) ||
     2753 +                    (iraflags & IRAF_IPSEC_SECURE)) {
     2754 +                        mp = ipsec_check_inbound_policy(mp, connp,
     2755 +                            ipha, NULL, ira);
     2756 +                        if (mp == NULL) {
     2757 +                                BUMP_MIB(ill->ill_ip_mib, ipIfStatsInDiscards);
     2758 +                                ip_drop_input("ipIfStatsInDiscards", mp, ill);
     2759 +                                CONN_DEC_REF(connp);
     2760 +                                return;
     2761 +                        }
     2762 +                }
     2763 +
     2764 +                BUMP_MIB(ill->ill_ip_mib, ipIfStatsHCInDelivers);
     2765 +                ira->ira_ill = ira->ira_rill = NULL;
     2766 +
     2767 +                SQUEUE_ENTER_ONE(connp->conn_sqp, mp, connp->conn_recv,
     2768 +                    connp, ira, ip_squeue_flag, SQTAG_IP_DCCP_INPUT);
     2769 +
     2770 +                ira->ira_ill = ill;
     2771 +                ira->ira_rill = rill;
     2772 +                return;
2717 2773          default:
2718 2774                  break;
2719 2775          }
2720 2776  
2721 2777          /*
2722 2778           * Clear hardware checksumming flag as it is currently only
2723 2779           * used by TCP and UDP.
2724 2780           */
2725 2781          DB_CKSUMFLAGS(mp) = 0;
2726 2782  
↓ open down ↓ 410 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX