diff options
-rw-r--r-- | libnet/src/libnet_build_cdp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnet/src/libnet_build_cdp.c b/libnet/src/libnet_build_cdp.c index 5681d5e..249b246 100644 --- a/libnet/src/libnet_build_cdp.c +++ b/libnet/src/libnet_build_cdp.c @@ -53,8 +53,8 @@ libnet_t *l, libnet_ptag_t ptag) return (-1); } - n = LIBNET_CDP_H + len + payload_s; - h = LIBNET_CDP_H + len + payload_s; + n = LIBNET_CDP_H + LIBNET_CDP_H + len + payload_s; + h = LIBNET_CDP_H + LIBNET_CDP_H + len + payload_s; /* * Find the existing protocol block if a ptag is specified, or create @@ -135,9 +135,9 @@ libnet_build_cdp_value(uint16_t type, uint16_t len, uint8_t *value, libnet_t *l, return (-1); } - memset(&cdp_value_hdr, 0, sizeof(cdp_value_hdr)); - cdp_value_hdr.cdp_type = htons(type); - cdp_value_hdr.cdp_len = htons(len + 4); /* 4 bytes for len and type */ + memset(&cdp_value_hdr, 0, sizeof(cdp_value_hdr)); + cdp_value_hdr.cdp_type = htons(type); + cdp_value_hdr.cdp_len = htons(len + LIBNET_CDP_VALUE_H); /* 4 bytes for len and type */ switch (type) { |