golang/go
在 GitHub 查看x/net/dns/dnsmessage: does not support RFC 2673 bit-string labels
Open
#52,489 创建于 2022年4月22日
NeedsInvestigationhelp wanted
仓库指标
- Star
- (133,883 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
What version of Go are you using (go version)?
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
What did you do?
` Here is TCP DNS payload hexStream := "00600006850000010001000100000776657273696f6e0462696e640000100003c00c0010000300000000002827392e382e327263312d5265644861742d392e382e322d302e36382e7263312e656c365f31302e38c00c00020003000000000002c00c"
data, _ := hex.DecodeString(hexStream)`
-
wireshark code here
case 0x40: //Extended label (RFC 2673) switch (component_len & 0x3f) { case 0x01: /* Bitstring label */ { int bit_count; int label_len; int print_len; bit_count = tvb_get_guint8(tvb, offset); offset++; label_len = (bit_count - 1) / 8 + 1; if (maxname > 0) { print_len = g_snprintf(np, maxname, "\\[x"); if (print_len <= maxname) { np += print_len; maxname -= print_len; } else { /* Nothing printed, as there's no room. Suppress all subsequent printing. */ maxname = 0; } } while (label_len--) { if (maxname > 0) { print_len = g_snprintf(np, maxname, "%02x", tvb_get_guint8(tvb, offset)); if (print_len <= maxname) { np += print_len; maxname -= print_len; } else { /* Nothing printed, as there's no room. Suppress all subsequent printing. */ maxname = 0; } } offset++; } if (maxname > 0) { print_len = g_snprintf(np, maxname, "/%d]", bit_count); if (print_len <= maxname) { np += print_len; maxname -= print_len; } else { /* Nothing printed, as there's no room. Suppress all subsequent printing. */ maxname = 0; } } } break; default: *name="<Unknown extended label>"; *name_len = (guint)strlen(*name); /* Parsing will probably fail from here on, since the */ /* label length is unknown... */ len = offset - start_offset; if (len < min_len) { THROW(ReportedBoundsError); } return len; } break;`
What did you expect to see?
