Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip.c
          +++ new/usr/src/uts/common/inet/ip/ip.c
↓ open down ↓ 9095 lines elided ↑ open up ↑
9096 9096                          case IPOPT_TS_TSANDADDR:
9097 9097                                  off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
9098 9098                                  break;
9099 9099                          default:
9100 9100                                  /*
9101 9101                                   * ip_*put_options should have already
9102 9102                                   * dropped this packet.
9103 9103                                   */
9104 9104                                  cmn_err(CE_PANIC, "ip_forward_options: "
9105 9105                                      "unknown IT - bug in ip_input_options?\n");
9106      -                                return (B_TRUE);        /* Keep "lint" happy */
9107 9106                          }
9108 9107                          if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
9109 9108                                  /* Increase overflow counter */
9110 9109                                  off = (opt[IPOPT_POS_OV_FLG] >> 4) + 1;
9111 9110                                  opt[IPOPT_POS_OV_FLG] =
9112 9111                                      (uint8_t)((opt[IPOPT_POS_OV_FLG] & 0x0F) |
9113 9112                                      (off << 4));
9114 9113                                  break;
9115 9114                          }
9116 9115                          off = opt[IPOPT_OFFSET] - 1;
↓ open down ↓ 206 lines elided ↑ open up ↑
9323 9322                          case IPOPT_TS_TSANDADDR:
9324 9323                                  off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
9325 9324                                  break;
9326 9325                          default:
9327 9326                                  /*
9328 9327                                   * ip_*put_options should have already
9329 9328                                   * dropped this packet.
9330 9329                                   */
9331 9330                                  cmn_err(CE_PANIC, "ip_input_local_options: "
9332 9331                                      "unknown IT - bug in ip_input_options?\n");
9333      -                                return (B_TRUE);        /* Keep "lint" happy */
9334 9332                          }
9335 9333                          if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
9336 9334                                  /* Increase overflow counter */
9337 9335                                  off = (opt[IPOPT_POS_OV_FLG] >> 4) + 1;
9338 9336                                  opt[IPOPT_POS_OV_FLG] =
9339 9337                                      (uint8_t)((opt[IPOPT_POS_OV_FLG] & 0x0F) |
9340 9338                                      (off << 4));
9341 9339                                  break;
9342 9340                          }
9343 9341                          off = opt[IPOPT_OFFSET] - 1;
↓ open down ↓ 2667 lines elided ↑ open up ↑
12011 12009                          case IPOPT_TS_TSANDADDR:
12012 12010                                  off = IP_ADDR_LEN + IPOPT_TS_TIMELEN;
12013 12011                                  break;
12014 12012                          default:
12015 12013                                  /*
12016 12014                                   * ip_*put_options should have already
12017 12015                                   * dropped this packet.
12018 12016                                   */
12019 12017                                  cmn_err(CE_PANIC, "ip_output_local_options: "
12020 12018                                      "unknown IT - bug in ip_output_options?\n");
12021      -                                return; /* Keep "lint" happy */
12022 12019                          }
12023 12020                          if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
12024 12021                                  /* Increase overflow counter */
12025 12022                                  off = (opt[IPOPT_POS_OV_FLG] >> 4) + 1;
12026 12023                                  opt[IPOPT_POS_OV_FLG] = (uint8_t)
12027 12024                                      (opt[IPOPT_POS_OV_FLG] & 0x0F) |
12028 12025                                      (off << 4);
12029 12026                                  break;
12030 12027                          }
12031 12028                          off = opt[IPOPT_OFFSET] - 1;
↓ open down ↓ 3262 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX