fix parser for option part in bgp open message.

struct for bgp open message is not round in size (29 bytes), so we can't
use sizeof for it.

svn path=/trunk/; revision=1310
This commit is contained in:
Jun-ichiro itojun Hagino 1999-12-13 09:56:37 +00:00
parent 939fa8362e
commit 08eb7a2b81
1 changed files with 3 additions and 1 deletions

View File

@ -280,8 +280,10 @@ dissect_bgp_open(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
(bgpo.bgpo_optlen == 1) ? "byte" : "bytes");
if (hlen > sizeof(struct bgp_open)) {
int openoff;
openoff = ((char *)&bgpo.bgpo_optlen - (char *)&bgpo) + 1;
proto_tree_add_text(tree,
offset + sizeof(struct bgp_open), hlen - sizeof(struct bgp_open),
offset + openoff, hlen - openoff,
"Optional parameters");
}
}