Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-pim.c:706

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dissect_pim

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-pim.c)expand/collapse
Show more  
 600  dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
 601      int offset = 0;
 602      guint8 pim_typever;
 603      guint length, pim_length;
 604      guint16 pim_cksum, computed_cksum;
 605      vec_t cksum_vec[4];
 606      guint32 phdr[2];
 607      const char *typestr;
 608      proto_tree *pim_tree = NULL;
 609      proto_item *ti;
 610      proto_tree *pimopt_tree = NULL;
 611      proto_item *tiopt;
 612   
 613      if (check_col(pinfo->cinfo, COL_PROTOCOL))
 614          col_set_str(pinfo->cinfo, COL_PROTOCOL, "PIM");
 615      if (check_col(pinfo->cinfo, COL_INFO))
 616          col_clear(pinfo->cinfo, COL_INFO);
 617   
 618      pim_typever = tvb_get_guint8(tvb, 0);
 619   
 620      switch (PIM_VER(pim_typever)) {
 621      case 2:
 622          typestr = val_to_str(PIM_TYPE(pim_typever), type2vals, "Unknown (%u)");
 623          break;
 624      case 1:     /* PIMv1 - we should never see this */
 625      default:
 626          typestr = "Unknown";
 627          break;
 628      }
 629   
 630      if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
 631          col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "PIMv%d",
 632              PIM_VER(pim_typever));
 633      }
 634      if (check_col(pinfo->cinfo, COL_INFO))
 635          col_add_str(pinfo->cinfo, COL_INFO, typestr);
 636   
 637      if (tree) {
 638          ti = proto_tree_add_item(tree, proto_pim, tvb, offset, -1, FALSE);
 639          pim_tree = proto_item_add_subtree(ti, ett_pim);
 640   
 641          proto_tree_add_uint(pim_tree, hf_pim_version, tvb, offset, 1,
 642              PIM_VER(pim_typever));
 643          proto_tree_add_uint(pim_tree, hf_pim_type, tvb, offset, 1,
 644              PIM_TYPE(pim_typever));
 645   
 646          pim_cksum = tvb_get_ntohs(tvb, offset + 2);
 647          length = tvb_length(tvb);
 648          if (PIM_VER(pim_typever) == 2) {
 649              /*
 650               * Well, it's PIM v2, so we can check whether this is a Register 
 651               * message, and thus can figure out how much to checksum and
 652               * whether to make the columns read-only.
 653               */
 654              if (PIM_TYPE(pim_typever) == 1) {
 655                  /*
 656                   * Register message - the PIM header is 8 bytes long.
 657                   * Also set the columns non-writable. Otherwise the IPv4 or
 658                   * IPv6 dissector for the encapsulated packet that caused
 659                   * this register will overwrite the PIM info in the columns.
 660                   */
 661                  pim_length = 8;
 662                  col_set_writable(pinfo->cinfo, FALSE);
 663              } else {
 664                  /*
 665                   * Other message - checksum the entire packet.
 666                   */
 667                  pim_length = tvb_reported_length(tvb);
 668              }
 669          } else {
 670              /*
 671               * We don't know what type of message this is, so say that 
 672               * the length is 0, to force it not to be checksummed.
 673               */
 674              pim_length = 0;
 675          }
 676          if (!pinfo->fragmented && length >= pim_length) {
 677              /*
 678               * The packet isn't part of a fragmented datagram and isn't
 679               * truncated, so we can checksum it.
 680               */
 681   
 682              switch (pinfo->src.type) {
 683              case AT_IPv4:
 684                  cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, pim_length);
 685                  cksum_vec[0].len = pim_length;
 686                  computed_cksum = in_cksum(&cksum_vec[0], 1);
 687                  break;
 688              case AT_IPv6:
 689                  /* Set up the fields of the pseudo-header. */
 690                  cksum_vec[0].ptr = pinfo->src.data;
 691                  cksum_vec[0].len = pinfo->src.len;
 692                  cksum_vec[1].ptr = pinfo->dst.data;
 693                  cksum_vec[1].len = pinfo->dst.len;
 694                  cksum_vec[2].ptr = (const guint8 *)&phdr;
 695                  phdr[0] = g_htonl(pim_length);
 696                  phdr[1] = g_htonl(IP_PROTO_PIM);
 697                  cksum_vec[2].len = 8;
 698                  cksum_vec[3].ptr = tvb_get_ptr(tvb, 0, pim_length);
 699                  cksum_vec[3].len = pim_length;
 700                  computed_cksum = in_cksum(&cksum_vec[0], 4);
 701                  break;
 702              default:
 703                  /* PIM is available for IPv4 and IPv6 right now */
 704                  computed_cksum = 0;     /* squelch GCC complaints */
 705                  DISSECTOR_ASSERT_NOT_REACHED();
 706                  break;
 707              }
 708   
 709              if (computed_cksum == 0) {
 710                  proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb,
 711                          offset + 2, 2, pim_cksum,
 712                          "Checksum: 0x%04x [correct]",
 713                          pim_cksum);
 714              } else {
 715                  proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb,
 716                          offset + 2, 2, pim_cksum,
 717                          "Checksum: 0x%04x [incorrect, should be 0x%04x]",
 718                          pim_cksum, in_cksum_shouldbe(pim_cksum, computed_cksum));
 719              }
 720          } else {
 721              proto_tree_add_uint(pim_tree, hf_pim_cksum, tvb,
 722                  offset + 2, 2, pim_cksum);
 723          }
 724   
 725          offset += 4;
 726   
 727          if (tvb_reported_length_remaining(tvb, offset) > 0) {
 728              tiopt = proto_tree_add_text(pim_tree, tvb, offset, -1,
 729                  "PIM parameters");
 730              pimopt_tree = proto_item_add_subtree(tiopt, ett_pim);
 731          } else 
 732              goto done;
 733   
 734          if (PIM_VER(pim_typever) != 2)
 735              goto done;
 736   
 737          /* version 2 decoder */
 738          switch (PIM_TYPE(pim_typever)) {
 739          case 0: /*hello*/
 740            {
 741              while (tvb_reported_length_remaining(tvb, offset) >= 2) {
 742                  guint16 hello_opt, opt_len;
 743                  guint16 holdtime;
 744                  guint16 lan_delay;
 745                  guint16 override_interval;
 746                  guint32 priority;
 747                  guint32 opt_value = 0;
 748   
 749                  hello_opt = tvb_get_ntohs(tvb, offset);
 750                  opt_len = tvb_get_ntohs(tvb, offset + 2);
 751   
 752                  if(opt_len == 2)
 753                          opt_value = tvb_get_ntohs(tvb, offset + 4);
 754                  if(opt_len == 4)
 755                          opt_value = tvb_get_ntohl(tvb, offset + 4);
 756   
 757                  switch(hello_opt) {
 758                  case 1: /* holdtime */
 759                          holdtime = opt_value;
 760                          proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 761                                              "Holdtime (%u): %us %s", hello_opt, holdtime,
 762                                              holdtime == 0xffff ? " (infty)" : "");
 763                          break;
 764                  case 2: /* LAN prune delay 
 765                           *
 766                           * 0                   1                   2                   3
 767                           * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 768                           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 769                           * |            Type = 2           |           Length = 4          |
 770                           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 771                           * |T|       LAN Prune Delay       |       Override Interval       |
 772                           * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 773                           */
 774                  {
 775                          proto_tree *sub_tree = NULL;
 776                          proto_item *landelay_option;
 777   
 778                          landelay_option = proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 779                                                          "LAN Prune Delay (%u)", hello_opt);
 780                          sub_tree = proto_item_add_subtree(landelay_option, ett_pim);
 781   
 782                          lan_delay = (opt_value & 0x7fff0000) >> 16;
 783                          override_interval = opt_value & 0x0000ffff;
 784                          proto_tree_add_text(sub_tree, tvb, offset + 4, 1,
 785                                              "T bit is %s",
 786                                              (opt_value & 0x80000000) ? "set" : "not set");
 787                          proto_tree_add_text(sub_tree, tvb, offset + 4, 2,
 788                                              "LAN Delay: %ums", lan_delay);
 789                          proto_tree_add_text(sub_tree, tvb, offset + 6, 2,
 790                                              "Override Interval: %ums", override_interval);
 791                          break;
 792                  }
 793                  case 19: /* priority */
 794                          priority = opt_value;
 795                          proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 796                                          "DR Priority (%u): %u", hello_opt, priority);
 797                          break;
 798                  case 20: /* generation ID */
 799                          proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 800                                              "Generation ID (%u): %d", hello_opt, opt_value);
 801                          break;
 802   
 803                  case 24: /* address list */
 804                  case 65001: /* address list (old implementations) */
 805                  {
 806                          int i;
 807                          proto_tree *sub_tree = NULL;
 808                          proto_item *addrlist_option;
 809   
 810                          addrlist_option = proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 811                                              "%sAddress List (%u)",
 812                                              hello_opt == 65001 ? "old " : "",
 813                                              hello_opt);
 814                          sub_tree = proto_item_add_subtree(addrlist_option, ett_pim);
 815   
 816                          for (i = offset + 4; i < offset + 4 + opt_len; ) {
 817                                  int advance;
 818                                  const char *s;
 819   
 820                                  s = dissect_pim_addr(tvb, i, pimv2_unicast, &advance);
 821                                  if (s == NULL)
 822                                          break;
 823                                  proto_tree_add_text(sub_tree, tvb, offset,  
 824                                                      advance, "Address: %s", s);
 825                                  i += advance;
 826                          }
 827                          break;
 828                  }
 829                  default:
 830                          proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len,
 831                                              "Unknown option (%u), length: %u, value: 0x%x",
 832                                              hello_opt, opt_len, opt_value);
 833                          break;
 834                  }
 835                  offset += 4 + opt_len;
 836              }
 837              break;
 838            }
 839   
 840          case 1: /* register */
 841            {
 842              guint32 flags;
 843              guint8 v_hl;
 844              tvbuff_t *next_tvb;
 845              proto_tree *flag_tree = NULL;
 846              proto_item *tiflag;
 847   
 848              flags = tvb_get_ntohl(tvb, offset);
 849              tiflag = proto_tree_add_text(pimopt_tree, tvb, offset, 4,
 850                  "Flags: 0x%08x", flags);
 851              flag_tree = proto_item_add_subtree(tiflag, ett_pim);
 852              proto_tree_add_text(flag_tree, tvb, offset, 1, "%s",
 853                  decode_boolean_bitfield(flags, 0x80000000, 32,
 854                      "Border", "Not border"));
 855              proto_tree_add_text(flag_tree, tvb, offset, 1, "%s",
 856                  decode_boolean_bitfield(flags, 0x40000000, 32,
 857                      "Null-Register", "Not Null-Register"));
 858              offset += 4;
 859   
 860              /*
 861               * The rest of the packet is a multicast data packet.
 862               */
 863              next_tvb = tvb_new_subset(tvb, offset, -1, -1);
 864   
 865              /*
 866               * It's an IP packet - determine whether it's IPv4 or IPv6.
 867               */
 868              v_hl = tvb_get_guint8(tvb, offset);
 869              switch((v_hl & 0xf0) >> 4) {
 870              case 0:     /* Null-Register dummy header.
 871                           * Has the same address family as the encapsulating PIM packet,
 872                           * e.g. an IPv6 data packet is encapsulated in IPv6 PIM packet.
 873                           */
 874                      if (pinfo->src.type == AT_IPv4) {
 875                              proto_tree_add_text(pimopt_tree, tvb, offset, -1,
 876                                                  "IPv4 dummy header");
 877                              proto_tree_add_text(pimopt_tree, tvb, offset + 12, 4,
 878                                                  "Source: %s",
 879                                                  ip_to_str(tvb_get_ptr(tvb, offset + 12, 4)));
 880                              proto_tree_add_text(pimopt_tree, tvb, offset + 16, 4,
 881                                                  "Group: %s",
 882                                                  ip_to_str(tvb_get_ptr(tvb, offset + 16, 4)));
 883                      } else if (pinfo->src.type == AT_IPv6) {
 884                              struct ip6_hdr ip6_hdr;
 885                              tvb_memcpy(tvb, (guint8 *)&ip6_hdr, offset,
 886                                         sizeof ip6_hdr);
 887                              proto_tree_add_text(pimopt_tree, tvb, offset, -1,
 888                                                  "IPv6 dummy header");
 889                              proto_tree_add_text(pimopt_tree, tvb,
 890                                                  offset + offsetof(struct ip6_hdr, ip6_src), 16,
 891                                                  "Source: %s",
 892                                                  ip6_to_str(&ip6_hdr.ip6_src));
 893                              proto_tree_add_text(pimopt_tree, tvb,
 894                                                  offset + offsetof(struct ip6_hdr, ip6_dst), 16,
 895                                                  "Group: %s",
 896                                                  ip6_to_str(&ip6_hdr.ip6_dst));
 897                      } else 
 898                              proto_tree_add_text(pimopt_tree, tvb, offset, -1,
 899                                                  "Dummy header for an unknown protocol");
 900                      break;
 901              case 4:     /* IPv4 */
 902  #if 0 
 903                      call_dissector(ip_handle, next_tvb, pinfo, tree);
 904  #else
 905                      call_dissector(ip_handle, next_tvb, pinfo, pimopt_tree);
 906  #endif
 907                      break;
 908              case 6:     /* IPv6 */
 909  #if 0 
 910                      call_dissector(ipv6_handle, next_tvb, pinfo, tree);
 911  #else
 912                      call_dissector(ipv6_handle, next_tvb, pinfo, pimopt_tree);
 913  #endif
 914                      break;
 915              default:
 916                      proto_tree_add_text(pimopt_tree, tvb, offset, -1,
 917                          "Unknown IP version %d", (v_hl & 0xf0) >> 4);
 918                      break;
 919              }
 920              break;
 921            }
 922   
 923          case 2: /* register-stop */
 924            {
 925              int advance;
 926              const char *s;
 927   
 928              s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 929              if (s == NULL)
 930                  break;
 931              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "Group: %s", s);
 932              offset += advance;
 933              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 934              if (s == NULL)
 935                  break;
 936              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "Source: %s", s);
 937              break;
 938            }
 939   
 940          case 3: /* join/prune */
 941          case 6: /* graft */
 942          case 7: /* graft-ack */
 943            {
 944              int advance;
 945              int off;
 946              const char *s;
 947              int ngroup, i, njoin, nprune, j;
 948              guint16 holdtime;
 949              proto_tree *grouptree = NULL;
 950              proto_item *tigroup;
 951              proto_tree *subtree = NULL;
 952              proto_item *tisub;
 953   
 954              if (PIM_TYPE(pim_typever) != 7) {
 955                  /* not graft-ack */
 956                  s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 957                  if (s == NULL)
 958                      break;
 959                  proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 960                      "Upstream-neighbor: %s", s);
 961                  offset += advance;
 962              }
 963   
 964              offset += 1;        /* skip reserved field */
 965   
 966              ngroup = tvb_get_guint8(tvb, offset);
 967              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 968                  "Groups: %u", ngroup);
 969              offset += 1;
 970   
 971              if (PIM_TYPE(pim_typever) != 7)     {
 972                  /* not graft-ack */
 973                  holdtime = tvb_get_ntohs(tvb, offset);
 974                  proto_tree_add_text(pimopt_tree, tvb, offset, 2,
 975                      "Holdtime: %u%s", holdtime,
 976                      holdtime == 0xffff ? " (infty)" : "");
 977              }
 978              offset += 2;
 979   
 980              for (i = 0; i < ngroup; i++) {
 981                  s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 982                  if (s == NULL)
 983                      goto breakbreak3;
 984                  tigroup = proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 985                      "Group %d: %s", i, s);
 986                  grouptree = proto_item_add_subtree(tigroup, ett_pim);
 987                  offset += advance;
 988   
 989                  njoin = tvb_get_ntohs(tvb, offset);
 990                  nprune = tvb_get_ntohs(tvb, offset + 2);
 991   
 992                  tisub = proto_tree_add_text(grouptree, tvb, offset, 2,
 993                      "Join: %d", njoin);
 994                  subtree = proto_item_add_subtree(tisub, ett_pim);
 995                  off = offset + 4;
 996                  for (j = 0; j < njoin; j++) {
 997                      s = dissect_pim_addr(tvb, off, pimv2_source,
 998                          &advance);
 999                      if (s == NULL)
 1000                          goto breakbreak3;
 1001                      proto_tree_add_text(subtree, tvb, off, advance,
 1002                          "IP address: %s", s);
 1003                      off += advance;
 1004                  }
 1005   
 1006                  tisub = proto_tree_add_text(grouptree, tvb, offset + 2, 2,
 1007                      "Prune: %d", nprune);
 1008                  subtree = proto_item_add_subtree(tisub, ett_pim);
 1009                  for (j = 0; j < nprune; j++) {
 1010                      s = dissect_pim_addr(tvb, off, pimv2_source,
 1011                          &advance);
 1012                      if (s == NULL)
 1013                          goto breakbreak3;
 1014                      proto_tree_add_text(subtree, tvb, off, advance,
 1015                          "IP address: %s", s);
 1016                      off += advance;
 1017                  }
 1018                  offset = off;
 1019              }
 1020      breakbreak3:
 1021              break;
 1022            }
 1023   
 1024          case 4: /* bootstrap */
 1025            {
 1026              const char *s;
 1027              int advance;
 1028              int i, j;
 1029              int frpcnt;
 1030              guint16 holdtime;
 1031              proto_tree *grouptree = NULL;
 1032              proto_item *tigroup;
 1033   
 1034              proto_tree_add_text(pimopt_tree, tvb, offset, 2,
 1035                  "Fragment tag: 0x%04x", tvb_get_ntohs(tvb, offset));
 1036              offset += 2;
 1037   
 1038              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1039                  "Hash mask len: %u", tvb_get_guint8(tvb, offset));
 1040              offset += 1;
 1041              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1042                  "BSR priority: %u", tvb_get_guint8(tvb, offset));
 1043              offset += 1;
 1044   
 1045              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1046              if (s == NULL)
 1047                  break;
 1048              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "BSR: %s", s);
 1049              offset += advance;
 1050   
 1051              for (i = 0; tvb_reported_length_remaining(tvb, offset) > 0; i++) {
 1052                  s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 1053                  if (s == NULL)
 1054                      goto breakbreak4;
 1055                  tigroup = proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 1056                      "Group %d: %s", i, s);
 1057                  grouptree = proto_item_add_subtree(tigroup, ett_pim);
 1058                  offset += advance;
 1059   
 1060                  proto_tree_add_text(grouptree, tvb, offset, 1,
 1061                      "RP count: %u", tvb_get_guint8(tvb, offset));
 1062                  offset += 1;
 1063                  frpcnt = tvb_get_guint8(tvb, offset);
 1064                  proto_tree_add_text(grouptree, tvb, offset, 1,
 1065                      "FRP count: %u", frpcnt);
 1066                  offset += 3;
 1067   
 1068                  for (j = 0; j < frpcnt; j++) {
 1069                      s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1070                      if (s == NULL)
 1071                          goto breakbreak4;
 1072                      proto_tree_add_text(grouptree, tvb, offset, advance,
 1073                          "RP %d: %s", j, s);
 1074                      offset += advance;
 1075   
 1076                      holdtime = tvb_get_ntohs(tvb, offset);
 1077                      proto_tree_add_text(grouptree, tvb, offset, 2,
 1078                          "Holdtime: %u%s", holdtime,
 1079                          holdtime == 0xffff ? " (infty)" : "");
 1080                      offset += 2;
 1081                      proto_tree_add_text(grouptree, tvb, offset, 1,
 1082                          "Priority: %u", tvb_get_guint8(tvb, offset));
 1083                      offset += 2;        /* also skips reserved field */
 1084                  }
 1085              }
 1086   
 1087      breakbreak4:
 1088              break;
 1089            }
 1090   
 1091          case 5: /* assert */
 1092            {
 1093              const char *s;
 1094              int advance;
 1095   
 1096              s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 1097              if (s == NULL)
 1098                  break;
 1099              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "Group: %s", s);
 1100              offset += advance;
 1101   
 1102              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1103              if (s == NULL)
 1104                  break;
 1105              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "Source: %s", s);
 1106              offset += advance;
 1107   
 1108              proto_tree_add_text(pimopt_tree, tvb, offset, 1, "%s",
 1109                  decode_boolean_bitfield(tvb_get_guint8(tvb, offset), 0x80, 8,
 1110                      "RP Tree", "Not RP Tree"));
 1111              proto_tree_add_text(pimopt_tree, tvb, offset, 4, "Preference: %u",
 1112                  tvb_get_ntohl(tvb, offset) & 0x7fffffff);
 1113              offset += 4;
 1114   
 1115              proto_tree_add_text(pimopt_tree, tvb, offset, 4, "Metric: %u",
 1116                  tvb_get_ntohl(tvb, offset));
 1117   
 1118              break;
 1119            }
 1120   
 1121          case 8: /* Candidate-RP-Advertisement */
 1122            {
 1123              const char *s;
 1124              int advance;
 1125              int pfxcnt;
 1126              guint16 holdtime;
 1127              int i;
 1128   
 1129              pfxcnt = tvb_get_guint8(tvb, offset);
 1130              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1131                  "Prefix-count: %u", pfxcnt);
 1132              offset += 1;
 1133              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1134                  "Priority: %u", tvb_get_guint8(tvb, offset));
 1135              offset += 1;
 1136              holdtime = tvb_get_ntohs(tvb, offset);
 1137              proto_tree_add_text(pimopt_tree, tvb, offset, 2,
 1138                  "Holdtime: %u%s", holdtime,
 1139                  holdtime == 0xffff ? " (infty)" : "");
 1140              offset += 2;
 1141   
 1142              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1143              if (s == NULL)
 1144                  break;
 1145              proto_tree_add_text(pimopt_tree, tvb, offset, advance, "RP: %s", s);
 1146              offset += advance;
 1147   
 1148              for (i = 0; i < pfxcnt; i++) {
 1149                  s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 1150                  if (s == NULL)
 1151                      goto breakbreak8;
 1152                  proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 1153                      "Group %d: %s", i, s);
 1154                  offset += advance;
 1155              }
 1156      breakbreak8:
 1157              break;
 1158            }
 1159   
 1160          case 9: /* State-Refresh */
 1161            {
 1162              const char *s;
 1163              int advance;
 1164   
 1165              s = dissect_pim_addr(tvb, offset, pimv2_group, &advance);
 1166              if (s == NULL)
 1167                  break;
 1168              proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 1169                  "Group: %s", s);
 1170              offset += advance;
 1171   
 1172              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1173              if (s == NULL)
 1174                  break;
 1175              proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 1176                  "Source: %s", s);
 1177              offset += advance;
 1178   
 1179              s = dissect_pim_addr(tvb, offset, pimv2_unicast, &advance);
 1180              if (s == NULL)
 1181                  break;
 1182              proto_tree_add_text(pimopt_tree, tvb, offset, advance,
 1183                  "Originator: %s", s);
 1184              offset += advance;
 1185   
 1186              proto_tree_add_text(pimopt_tree, tvb, offset, 1, "Rendezvous Point Tree %s",
 1187                  decode_boolean_bitfield(tvb_get_guint8(tvb, offset), 1, 1,
 1188                      "set", "clear"));
 1189              proto_tree_add_text(pimopt_tree, tvb, offset, 4,
 1190                  "Metric Preference: %u", tvb_get_ntohl(tvb, offset) & 0x7FFFFFFF);
 1191              offset += 4;
 1192   
 1193              proto_tree_add_text(pimopt_tree, tvb, offset, 4,
 1194                  "Metric: %u", tvb_get_ntohl(tvb, offset));
 1195              offset += 4;
 1196   
 1197              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1198                  "Masklen: %u", tvb_get_guint8(tvb, offset));
 1199              offset += 1;
 1200   
 1201              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1202                  "TTL: %u", tvb_get_guint8(tvb, offset));
 1203              offset += 1;
 1204   
 1205              proto_tree_add_text(pimopt_tree, tvb, offset, 1, "Prune indicator %s",
 1206                  decode_boolean_bitfield(tvb_get_guint8(tvb, offset), 0x80, 8,
 1207                      "set", "clear"));
 1208              proto_tree_add_text(pimopt_tree, tvb, offset, 1, "Prune now %s",
 1209                  decode_boolean_bitfield(tvb_get_guint8(tvb, offset), 0x40, 8,
 1210                      "set", "clear"));
 1211              proto_tree_add_text(pimopt_tree, tvb, offset, 1, "Assert override %s",
 1212                  decode_boolean_bitfield(tvb_get_guint8(tvb, offset), 0x20, 8,
 1213                      "set", "clear"));
 1214              offset += 1;
 1215   
 1216              proto_tree_add_text(pimopt_tree, tvb, offset, 1,
 1217                  "Interval: %u", tvb_get_guint8(tvb, offset));
 1218              offset += 1;
 1219   
 1220              break;
 1221            }
 1222   
 1223          default:
 1224              break;
 1225          }
 1226      }
 1227  done:;
 1228  }
Show more  




Change Warning 2885.32359 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: