lldpd_alloc_mgmt:
  265|    258|{
  266|    258|	struct lldpd_mgmt *mgmt;
  267|       |
  268|    258|	log_debug("alloc", "allocate a new management address (family: %d)", family);
  269|       |
  270|    258|	if (family <= LLDPD_AF_UNSPEC || family >= LLDPD_AF_LAST) {
  ------------------
  |  Branch (270:6): [True: 0, False: 258]
  |  Branch (270:35): [True: 0, False: 258]
  ------------------
  271|      0|		errno = EAFNOSUPPORT;
  272|      0|		return NULL;
  273|      0|	}
  274|    258|	if (addrsize > LLDPD_MGMT_MAXADDRSIZE) {
  ------------------
  |  |  157|    258|#define LLDPD_MGMT_MAXADDRSIZE 16 /* sizeof(struct in6_addr) */
  ------------------
  |  Branch (274:6): [True: 0, False: 258]
  ------------------
  275|      0|		errno = EOVERFLOW;
  276|      0|		return NULL;
  277|      0|	}
  278|    258|	mgmt = calloc(1, sizeof(struct lldpd_mgmt));
  279|    258|	if (mgmt == NULL) {
  ------------------
  |  Branch (279:6): [True: 0, False: 258]
  ------------------
  280|      0|		errno = ENOMEM;
  281|      0|		return NULL;
  282|      0|	}
  283|    258|	mgmt->m_family = family;
  284|    258|	memcpy(&mgmt->m_addr, addrptr, addrsize);
  285|    258|	mgmt->m_addrsize = addrsize;
  286|    258|	mgmt->m_iface = iface;
  287|    258|	return mgmt;
  288|    258|}

edp_decode:
  221|    382|{
  222|    382|	struct lldpd_chassis *chassis;
  223|    382|	struct lldpd_port *port;
  224|    382|#  ifdef ENABLE_DOT1
  225|    382|	struct lldpd_mgmt *mgmt, *mgmt_next, *m;
  226|    382|	struct lldpd_vlan *lvlan = NULL, *lvlan_next;
  227|    382|#  endif
  228|    382|	const unsigned char edpaddr[] = EDP_MULTICAST_ADDR;
  ------------------
  |  |   22|    382|  {                                    \
  |  |   23|    382|    0x00, 0xe0, 0x2b, 0x00, 0x00, 0x00 \
  |  |   24|    382|  }
  ------------------
  229|    382|	int length, gotend = 0, gotvlans = 0, edp_len, tlv_len, tlv_type;
  230|    382|	int edp_port, edp_slot;
  231|    382|	u_int8_t *pos, *pos_edp, *tlv;
  232|    382|	u_int8_t version[4];
  233|    382|#  ifdef ENABLE_DOT1
  234|    382|	struct in_addr address;
  235|    382|	struct lldpd_port *oport;
  236|    382|#  endif
  237|       |
  238|    382|	log_debug("edp", "decode EDP frame on port %s", hardware->h_ifname);
  239|       |
  240|    382|	if ((chassis = calloc(1, sizeof(struct lldpd_chassis))) == NULL) {
  ------------------
  |  Branch (240:6): [True: 0, False: 382]
  ------------------
  241|      0|		log_warn("edp", "failed to allocate remote chassis");
  242|      0|		return -1;
  243|      0|	}
  244|    382|	TAILQ_INIT(&chassis->c_mgmt);
  ------------------
  |  Branch (244:2): [Folded, False: 382]
  ------------------
  245|    382|	if ((port = calloc(1, sizeof(struct lldpd_port))) == NULL) {
  ------------------
  |  Branch (245:6): [True: 0, False: 382]
  ------------------
  246|      0|		log_warn("edp", "failed to allocate remote port");
  247|      0|		free(chassis);
  248|      0|		return -1;
  249|      0|	}
  250|    382|#  ifdef ENABLE_DOT1
  251|    382|	TAILQ_INIT(&port->p_vlans);
  ------------------
  |  Branch (251:2): [Folded, False: 382]
  ------------------
  252|    382|#  endif
  253|       |
  254|    382|	length = s;
  255|    382|	pos = (u_int8_t *)frame;
  256|       |
  257|    382|	if (length < 2 * ETHER_ADDR_LEN + sizeof(u_int16_t) + 8 /* LLC */ + 10 +
  ------------------
  |  Branch (257:6): [True: 13, False: 369]
  ------------------
  258|    382|		ETHER_ADDR_LEN /* EDP header */) {
  259|     13|		log_warnx("edp", "too short EDP frame received on %s",
  260|     13|		    hardware->h_ifname);
  261|     13|		goto malformed;
  262|     13|	}
  263|       |
  264|    369|	if (PEEK_CMP(edpaddr, sizeof(edpaddr)) != 0) {
  ------------------
  |  |   80|    369|  (length -= (bytes), pos += (bytes), memcmp(pos - bytes, value, bytes))
  ------------------
  |  Branch (264:6): [True: 51, False: 318]
  ------------------
  265|     51|		log_info("edp",
  266|     51|		    "frame not targeted at EDP multicast address received on %s",
  267|     51|		    hardware->h_ifname);
  268|     51|		goto malformed;
  269|     51|	}
  270|    318|	PEEK_DISCARD(ETHER_ADDR_LEN);
  ------------------
  |  |   72|    318|  do {                      \
  |  |   73|    318|    length -= (bytes);      \
  |  |   74|    318|    pos += (bytes);         \
  |  |   75|    318|  } while (0)
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 318]
  |  |  ------------------
  ------------------
  271|    318|	PEEK_DISCARD_UINT16;
  ------------------
  |  |   77|    318|#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2)
  |  |  ------------------
  |  |  |  |   72|    318|  do {                      \
  |  |  |  |   73|    318|    length -= (bytes);      \
  |  |  |  |   74|    318|    pos += (bytes);         \
  |  |  |  |   75|    318|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 318]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|    318|	PEEK_DISCARD(6); /* LLC: DSAP + SSAP + control + org */
  ------------------
  |  |   72|    318|  do {                      \
  |  |   73|    318|    length -= (bytes);      \
  |  |   74|    318|    pos += (bytes);         \
  |  |   75|    318|  } while (0)
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 318]
  |  |  ------------------
  ------------------
  273|    318|	if (PEEK_UINT16 != LLC_PID_EDP) {
  ------------------
  |  |   63|    318|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    318|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    318|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    318|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	if (PEEK_UINT16 != LLC_PID_EDP) {
  ------------------
  |  |   29|    318|#define LLC_PID_EDP 0x00bb
  ------------------
  |  Branch (273:6): [True: 25, False: 293]
  ------------------
  274|     25|		log_debug("edp", "incorrect LLC protocol ID received on %s",
  275|     25|		    hardware->h_ifname);
  276|     25|		goto malformed;
  277|     25|	}
  278|       |
  279|    293|	(void)PEEK_SAVE(pos_edp); /* Save the start of EDP packet */
  ------------------
  |  |   81|    293|#define PEEK_SAVE POKE_SAVE
  |  |  ------------------
  |  |  |  |   46|    293|#define POKE_SAVE(where) (where = pos, 1)
  |  |  ------------------
  ------------------
  280|    293|	if (PEEK_UINT8 != 1) {
  ------------------
  |  |   62|    293|#define PEEK_UINT8 PEEK(types.f_uint8, )
  |  |  ------------------
  |  |  |  |   60|    293|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    293|      func(type))
  |  |  ------------------
  ------------------
  |  Branch (280:6): [True: 9, False: 284]
  ------------------
  281|      9|		log_warnx("edp", "incorrect EDP version for frame received on %s",
  282|      9|		    hardware->h_ifname);
  283|      9|		goto malformed;
  284|      9|	}
  285|    284|	PEEK_DISCARD_UINT8; /* Reserved */
  ------------------
  |  |   76|    284|#define PEEK_DISCARD_UINT8 PEEK_DISCARD(1)
  |  |  ------------------
  |  |  |  |   72|    284|  do {                      \
  |  |  |  |   73|    284|    length -= (bytes);      \
  |  |  |  |   74|    284|    pos += (bytes);         \
  |  |  |  |   75|    284|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 284]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|    284|	edp_len = PEEK_UINT16;
  ------------------
  |  |   63|    284|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    284|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    284|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    284|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|    284|	PEEK_DISCARD_UINT16;	/* Checksum */
  ------------------
  |  |   77|    284|#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2)
  |  |  ------------------
  |  |  |  |   72|    284|  do {                      \
  |  |  |  |   73|    284|    length -= (bytes);      \
  |  |  |  |   74|    284|    pos += (bytes);         \
  |  |  |  |   75|    284|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 284]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|    284|	PEEK_DISCARD_UINT16;	/* Sequence */
  ------------------
  |  |   77|    284|#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2)
  |  |  ------------------
  |  |  |  |   72|    284|  do {                      \
  |  |  |  |   73|    284|    length -= (bytes);      \
  |  |  |  |   74|    284|    pos += (bytes);         \
  |  |  |  |   75|    284|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 284]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|    284|	if (PEEK_UINT16 != 0) { /* ID Type = 0 = MAC */
  ------------------
  |  |   63|    284|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    284|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    284|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    284|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (289:6): [True: 16, False: 268]
  ------------------
  290|     16|		log_warnx("edp", "incorrect device id type for frame received on %s",
  291|     16|		    hardware->h_ifname);
  292|     16|		goto malformed;
  293|     16|	}
  294|    268|	if (edp_len > length + 10) {
  ------------------
  |  Branch (294:6): [True: 11, False: 257]
  ------------------
  295|     11|		log_warnx("edp", "incorrect size for EDP frame received on %s",
  296|     11|		    hardware->h_ifname);
  297|     11|		goto malformed;
  298|     11|	}
  299|    257|	port->p_ttl = cfg ? cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold : 0;
  ------------------
  |  Branch (299:16): [True: 257, False: 0]
  ------------------
  300|    257|	port->p_ttl = MIN((port->p_ttl + 999) / 1000, 65535);
  ------------------
  |  Branch (300:16): [True: 257, False: 0]
  ------------------
  301|    257|	chassis->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
  ------------------
  |  |   34|    257|#define LLDP_CHASSISID_SUBTYPE_LLADDR 4
  ------------------
  302|    257|	chassis->c_id_len = ETHER_ADDR_LEN;
  303|    257|	if ((chassis->c_id = (char *)malloc(ETHER_ADDR_LEN)) == NULL) {
  ------------------
  |  Branch (303:6): [True: 0, False: 257]
  ------------------
  304|      0|		log_warn("edp", "unable to allocate memory for chassis ID");
  305|      0|		goto malformed;
  306|      0|	}
  307|    257|	PEEK_BYTES(chassis->c_id, ETHER_ADDR_LEN);
  ------------------
  |  |   66|    257|  do {                           \
  |  |   67|    257|    memcpy(value, pos, bytes);   \
  |  |   68|    257|    length -= (bytes);           \
  |  |   69|    257|    pos += (bytes);              \
  |  |   70|    257|  } while (0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 257]
  |  |  ------------------
  ------------------
  308|       |
  309|       |#  ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  310|       |	/* Let's check checksum */
  311|       |	if (frame_checksum(pos_edp, edp_len, 0) != 0) {
  312|       |		log_warnx("edp", "incorrect EDP checksum for frame received on %s",
  313|       |		    hardware->h_ifname);
  314|       |		goto malformed;
  315|       |	}
  316|       |#  endif
  317|       |
  318|  3.34k|	while (length && !gotend) {
  ------------------
  |  Branch (318:9): [True: 3.21k, False: 132]
  |  Branch (318:19): [True: 3.18k, False: 21]
  ------------------
  319|  3.18k|		if (length < 4) {
  ------------------
  |  Branch (319:7): [True: 11, False: 3.17k]
  ------------------
  320|     11|			log_warnx("edp",
  321|     11|			    "EDP TLV header is too large for "
  322|     11|			    "frame received on %s",
  323|     11|			    hardware->h_ifname);
  324|     11|			goto malformed;
  325|     11|		}
  326|  3.17k|		if (PEEK_UINT8 != EDP_TLV_MARKER) {
  ------------------
  |  |   62|  3.17k|#define PEEK_UINT8 PEEK(types.f_uint8, )
  |  |  ------------------
  |  |  |  |   60|  3.17k|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|  3.17k|      func(type))
  |  |  ------------------
  ------------------
              		if (PEEK_UINT8 != EDP_TLV_MARKER) {
  ------------------
  |  |   31|  3.17k|#define EDP_TLV_MARKER 0x99
  ------------------
  |  Branch (326:7): [True: 17, False: 3.16k]
  ------------------
  327|     17|			log_warnx("edp",
  328|     17|			    "incorrect marker starting EDP TLV header for frame "
  329|     17|			    "received on %s",
  330|     17|			    hardware->h_ifname);
  331|     17|			goto malformed;
  332|     17|		}
  333|  3.16k|		tlv_type = PEEK_UINT8;
  ------------------
  |  |   62|  3.16k|#define PEEK_UINT8 PEEK(types.f_uint8, )
  |  |  ------------------
  |  |  |  |   60|  3.16k|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|  3.16k|      func(type))
  |  |  ------------------
  ------------------
  334|  3.16k|		tlv_len = PEEK_UINT16 - 4;
  ------------------
  |  |   63|  3.16k|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|  3.16k|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|  3.16k|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  3.16k|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  335|  3.16k|		(void)PEEK_SAVE(tlv);
  ------------------
  |  |   81|  3.16k|#define PEEK_SAVE POKE_SAVE
  |  |  ------------------
  |  |  |  |   46|  3.16k|#define POKE_SAVE(where) (where = pos, 1)
  |  |  ------------------
  ------------------
  336|  3.16k|		if ((tlv_len < 0) || (tlv_len > length)) {
  ------------------
  |  Branch (336:7): [True: 8, False: 3.15k]
  |  Branch (336:24): [True: 42, False: 3.11k]
  ------------------
  337|     50|			log_debug("edp",
  338|     50|			    "incorrect size in EDP TLV header for frame "
  339|     50|			    "received on %s",
  340|     50|			    hardware->h_ifname);
  341|       |			/* Some poor old Extreme Summit are quite bogus */
  342|     50|			gotend = 1;
  343|     50|			break;
  344|     50|		}
  345|  3.11k|		switch (tlv_type) {
  346|    147|		case EDP_TLV_INFO:
  ------------------
  |  Branch (346:3): [True: 147, False: 2.96k]
  ------------------
  347|    147|			CHECK_TLV_SIZE(32, "Info");
  ------------------
  |  |  210|    147|    do {                                                           \
  |  |  211|    147|      if (tlv_len < (x)) {                                         \
  |  |  ------------------
  |  |  |  Branch (211:11): [True: 10, False: 137]
  |  |  ------------------
  |  |  212|     10|	log_warnx("edp", name " EDP TLV too short received on %s", \
  |  |  213|     10|	    hardware->h_ifname);                                   \
  |  |  214|     10|	goto malformed;                                            \
  |  |  215|     10|      }                                                            \
  |  |  216|    147|    } while (0)
  |  |  ------------------
  |  |  |  Branch (216:14): [Folded, False: 137]
  |  |  ------------------
  ------------------
  348|    137|			port->p_id_subtype = LLDP_PORTID_SUBTYPE_IFNAME;
  ------------------
  |  |   45|    137|#define LLDP_PORTID_SUBTYPE_IFNAME 5
  ------------------
  349|    137|			edp_slot = PEEK_UINT16;
  ------------------
  |  |   63|    137|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    137|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    137|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    137|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|    137|			edp_port = PEEK_UINT16;
  ------------------
  |  |   63|    137|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    137|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    137|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    137|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  351|    137|			free(port->p_id);
  352|    137|			port->p_id_len =
  353|    137|			    asprintf(&port->p_id, "%d/%d", edp_slot + 1, edp_port + 1);
  354|    137|			if (port->p_id_len == -1) {
  ------------------
  |  Branch (354:8): [True: 0, False: 137]
  ------------------
  355|      0|				log_warn("edp",
  356|      0|				    "unable to allocate memory for "
  357|      0|				    "port ID");
  358|      0|				goto malformed;
  359|      0|			}
  360|    137|			free(port->p_descr);
  361|    137|			if (asprintf(&port->p_descr, "Slot %d / Port %d", edp_slot + 1,
  ------------------
  |  Branch (361:8): [True: 0, False: 137]
  ------------------
  362|    137|				edp_port + 1) == -1) {
  363|      0|				log_warn("edp",
  364|      0|				    "unable to allocate memory for "
  365|      0|				    "port description");
  366|      0|				goto malformed;
  367|      0|			}
  368|    137|			PEEK_DISCARD_UINT16; /* vchassis */
  ------------------
  |  |   77|    137|#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2)
  |  |  ------------------
  |  |  |  |   72|    137|  do {                      \
  |  |  |  |   73|    137|    length -= (bytes);      \
  |  |  |  |   74|    137|    pos += (bytes);         \
  |  |  |  |   75|    137|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 137]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  369|    137|			PEEK_DISCARD(6);     /* Reserved */
  ------------------
  |  |   72|    137|  do {                      \
  |  |   73|    137|    length -= (bytes);      \
  |  |   74|    137|    pos += (bytes);         \
  |  |   75|    137|  } while (0)
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 137]
  |  |  ------------------
  ------------------
  370|    137|			PEEK_BYTES(version, 4);
  ------------------
  |  |   66|    137|  do {                           \
  |  |   67|    137|    memcpy(value, pos, bytes);   \
  |  |   68|    137|    length -= (bytes);           \
  |  |   69|    137|    pos += (bytes);              \
  |  |   70|    137|  } while (0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 137]
  |  |  ------------------
  ------------------
  371|    137|			free(chassis->c_descr);
  372|    137|			if (asprintf(&chassis->c_descr,
  ------------------
  |  Branch (372:8): [True: 0, False: 137]
  ------------------
  373|    137|				"EDP enabled device, version %d.%d.%d.%d", version[0],
  374|    137|				version[1], version[2], version[3]) == -1) {
  375|      0|				log_warn("edp",
  376|      0|				    "unable to allocate memory for "
  377|      0|				    "chassis description");
  378|      0|				goto malformed;
  379|      0|			}
  380|    137|			break;
  381|    429|		case EDP_TLV_DISPLAY:
  ------------------
  |  Branch (381:3): [True: 429, False: 2.68k]
  ------------------
  382|    429|			free(chassis->c_name);
  383|    429|			if ((chassis->c_name = (char *)calloc(1, tlv_len + 1)) ==
  ------------------
  |  Branch (383:8): [True: 0, False: 429]
  ------------------
  384|    429|			    NULL) {
  385|      0|				log_warn("edp",
  386|      0|				    "unable to allocate memory for chassis "
  387|      0|				    "name");
  388|      0|				goto malformed;
  389|      0|			}
  390|       |			/* TLV display contains a lot of garbage */
  391|    429|			PEEK_BYTES(chassis->c_name, tlv_len);
  ------------------
  |  |   66|    429|  do {                           \
  |  |   67|    429|    memcpy(value, pos, bytes);   \
  |  |   68|    429|    length -= (bytes);           \
  |  |   69|    429|    pos += (bytes);              \
  |  |   70|    429|  } while (0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 429]
  |  |  ------------------
  ------------------
  392|    429|			break;
  393|     39|		case EDP_TLV_NULL:
  ------------------
  |  Branch (393:3): [True: 39, False: 3.07k]
  ------------------
  394|     39|			if (tlv_len != 0) {
  ------------------
  |  Branch (394:8): [True: 10, False: 29]
  ------------------
  395|     10|				log_warnx("edp",
  396|     10|				    "null tlv with incorrect size in frame "
  397|     10|				    "received on %s",
  398|     10|				    hardware->h_ifname);
  399|     10|				goto malformed;
  400|     10|			}
  401|     29|			if (length)
  ------------------
  |  Branch (401:8): [True: 21, False: 8]
  ------------------
  402|     21|				log_debug("edp", "extra data after edp frame on %s",
  403|     21|				    hardware->h_ifname);
  404|     29|			gotend = 1;
  405|     29|			break;
  406|    375|		case EDP_TLV_VLAN:
  ------------------
  |  Branch (406:3): [True: 375, False: 2.73k]
  ------------------
  407|    375|#  ifdef ENABLE_DOT1
  408|    375|			CHECK_TLV_SIZE(12, "VLAN");
  ------------------
  |  |  210|    375|    do {                                                           \
  |  |  211|    375|      if (tlv_len < (x)) {                                         \
  |  |  ------------------
  |  |  |  Branch (211:11): [True: 6, False: 369]
  |  |  ------------------
  |  |  212|      6|	log_warnx("edp", name " EDP TLV too short received on %s", \
  |  |  213|      6|	    hardware->h_ifname);                                   \
  |  |  214|      6|	goto malformed;                                            \
  |  |  215|      6|      }                                                            \
  |  |  216|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (216:14): [Folded, False: 369]
  |  |  ------------------
  ------------------
  409|    369|			if ((lvlan = (struct lldpd_vlan *)calloc(1,
  ------------------
  |  Branch (409:8): [True: 0, False: 369]
  ------------------
  410|    369|				 sizeof(struct lldpd_vlan))) == NULL) {
  411|      0|				log_warn("edp", "unable to allocate vlan");
  412|      0|				goto malformed;
  413|      0|			}
  414|    369|			PEEK_DISCARD_UINT16;	    /* Flags + reserved */
  ------------------
  |  |   77|    369|#define PEEK_DISCARD_UINT16 PEEK_DISCARD(2)
  |  |  ------------------
  |  |  |  |   72|    369|  do {                      \
  |  |  |  |   73|    369|    length -= (bytes);      \
  |  |  |  |   74|    369|    pos += (bytes);         \
  |  |  |  |   75|    369|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:12): [Folded, False: 369]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  415|    369|			lvlan->v_vid = PEEK_UINT16; /* VID */
  ------------------
  |  |   63|    369|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  ------------------
  |  |  |  |   60|    369|  (memcpy(&type, pos, sizeof(type)), length -= sizeof(type), pos += sizeof(type), \
  |  |  |  |   61|    369|      func(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|    369|#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|    369|			PEEK_DISCARD(4);	    /* Reserved */
  ------------------
  |  |   72|    369|  do {                      \
  |  |   73|    369|    length -= (bytes);      \
  |  |   74|    369|    pos += (bytes);         \
  |  |   75|    369|  } while (0)
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 369]
  |  |  ------------------
  ------------------
  417|    369|			PEEK_BYTES(&address, sizeof(address));
  ------------------
  |  |   66|    369|  do {                           \
  |  |   67|    369|    memcpy(value, pos, bytes);   \
  |  |   68|    369|    length -= (bytes);           \
  |  |   69|    369|    pos += (bytes);              \
  |  |   70|    369|  } while (0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 369]
  |  |  ------------------
  ------------------
  418|       |
  419|    369|			if (address.s_addr != INADDR_ANY) {
  ------------------
  |  Branch (419:8): [True: 258, False: 111]
  ------------------
  420|    258|				mgmt = lldpd_alloc_mgmt(LLDPD_AF_IPV4, &address,
  421|    258|				    sizeof(struct in_addr), 0);
  422|    258|				if (mgmt == NULL) {
  ------------------
  |  Branch (422:9): [True: 0, False: 258]
  ------------------
  423|      0|					log_warn("edp", "Out of memory");
  424|      0|					goto malformed;
  425|      0|				}
  426|    258|				TAILQ_INSERT_TAIL(&chassis->c_mgmt, mgmt, m_entries);
  ------------------
  |  Branch (426:5): [Folded, False: 258]
  ------------------
  427|    258|			}
  428|       |
  429|    369|			if ((lvlan->v_name = (char *)calloc(1, tlv_len + 1 - 12)) ==
  ------------------
  |  Branch (429:8): [True: 0, False: 369]
  ------------------
  430|    369|			    NULL) {
  431|      0|				log_warn("edp", "unable to allocate vlan name");
  432|      0|				goto malformed;
  433|      0|			}
  434|    369|			PEEK_BYTES(lvlan->v_name, tlv_len - 12);
  ------------------
  |  |   66|    369|  do {                           \
  |  |   67|    369|    memcpy(value, pos, bytes);   \
  |  |   68|    369|    length -= (bytes);           \
  |  |   69|    369|    pos += (bytes);              \
  |  |   70|    369|  } while (0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 369]
  |  |  ------------------
  ------------------
  435|       |
  436|    369|			TAILQ_INSERT_TAIL(&port->p_vlans, lvlan, v_entries);
  ------------------
  |  Branch (436:4): [Folded, False: 369]
  ------------------
  437|    369|			lvlan = NULL;
  438|    369|#  endif
  439|    369|			gotvlans = 1;
  440|    369|			break;
  441|  2.12k|		default:
  ------------------
  |  Branch (441:3): [True: 2.12k, False: 990]
  ------------------
  442|  2.12k|			log_debug("edp", "unknown EDP TLV type (%d) received on %s",
  443|  2.12k|			    tlv_type, hardware->h_ifname);
  444|  2.12k|			hardware->h_rx_unrecognized_cnt++;
  445|  3.11k|		}
  446|  3.08k|		PEEK_DISCARD(tlv + tlv_len - pos);
  ------------------
  |  |   72|  3.08k|  do {                      \
  |  |   73|  3.08k|    length -= (bytes);      \
  |  |   74|  3.08k|    pos += (bytes);         \
  |  |   75|  3.08k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 3.08k]
  |  |  ------------------
  ------------------
  447|  3.08k|	}
  448|    203|	if ((chassis->c_id == NULL) || (port->p_id == NULL) ||
  ------------------
  |  Branch (448:6): [True: 0, False: 203]
  |  Branch (448:33): [True: 145, False: 58]
  ------------------
  449|     58|	    (chassis->c_name == NULL) || (chassis->c_descr == NULL) ||
  ------------------
  |  Branch (449:6): [True: 17, False: 41]
  |  Branch (449:35): [True: 0, False: 41]
  ------------------
  450|    163|	    (port->p_descr == NULL) || (gotend == 0)) {
  ------------------
  |  Branch (450:6): [True: 0, False: 41]
  |  Branch (450:33): [True: 1, False: 40]
  ------------------
  451|    163|#  ifdef ENABLE_DOT1
  452|    163|		if (gotvlans && gotend) {
  ------------------
  |  Branch (452:7): [True: 72, False: 91]
  |  Branch (452:19): [True: 5, False: 67]
  ------------------
  453|       |			/* VLAN can be sent in a separate frames. We need to add
  454|       |			 * those vlans to an existing port */
  455|      5|			TAILQ_FOREACH (oport, &hardware->h_rports, p_entries) {
  ------------------
  |  Branch (455:4): [True: 0, False: 5]
  ------------------
  456|      0|				if (!((oport->p_protocol == LLDPD_MODE_EDP) &&
  ------------------
  |  |  341|      0|#define LLDPD_MODE_EDP 5
  ------------------
  |  Branch (456:11): [True: 0, False: 0]
  ------------------
  457|      0|					(oport->p_chassis->c_id_subtype ==
  ------------------
  |  Branch (457:6): [True: 0, False: 0]
  ------------------
  458|      0|					    chassis->c_id_subtype) &&
  459|      0|					(oport->p_chassis->c_id_len ==
  ------------------
  |  Branch (459:6): [True: 0, False: 0]
  ------------------
  460|      0|					    chassis->c_id_len) &&
  461|      0|					(memcmp(oport->p_chassis->c_id, chassis->c_id,
  ------------------
  |  Branch (461:6): [True: 0, False: 0]
  ------------------
  462|      0|					     chassis->c_id_len) == 0)))
  463|      0|					continue;
  464|       |				/* We attach the VLANs to the found port */
  465|      0|				lldpd_vlan_cleanup(oport);
  466|      0|				for (lvlan = TAILQ_FIRST(&port->p_vlans); lvlan != NULL;
  ------------------
  |  Branch (466:47): [True: 0, False: 0]
  ------------------
  467|      0|				     lvlan = lvlan_next) {
  468|      0|					lvlan_next = TAILQ_NEXT(lvlan, v_entries);
  469|      0|					TAILQ_REMOVE(&port->p_vlans, lvlan, v_entries);
  ------------------
  |  Branch (469:6): [True: 0, False: 0]
  |  Branch (469:6): [Folded, False: 0]
  ------------------
  470|      0|					TAILQ_INSERT_TAIL(&oport->p_vlans, lvlan,
  ------------------
  |  Branch (470:6): [Folded, False: 0]
  ------------------
  471|      0|					    v_entries);
  472|      0|				}
  473|       |				/* And the IP addresses */
  474|      0|				for (mgmt = TAILQ_FIRST(&chassis->c_mgmt); mgmt != NULL;
  ------------------
  |  Branch (474:48): [True: 0, False: 0]
  ------------------
  475|      0|				     mgmt = mgmt_next) {
  476|      0|					mgmt_next = TAILQ_NEXT(mgmt, m_entries);
  477|      0|					TAILQ_REMOVE(&chassis->c_mgmt, mgmt, m_entries);
  ------------------
  |  Branch (477:6): [True: 0, False: 0]
  |  Branch (477:6): [Folded, False: 0]
  ------------------
  478|       |					/* Don't add an address that already exists! */
  479|      0|					TAILQ_FOREACH (m, &oport->p_chassis->c_mgmt,
  ------------------
  |  Branch (479:6): [True: 0, False: 0]
  ------------------
  480|      0|					    m_entries)
  481|      0|						if (m->m_family == mgmt->m_family &&
  ------------------
  |  Branch (481:11): [True: 0, False: 0]
  ------------------
  482|      0|						    !memcmp(&m->m_addr, &mgmt->m_addr,
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|							sizeof(m->m_addr)))
  484|      0|							break;
  485|      0|					if (m == NULL)
  ------------------
  |  Branch (485:10): [True: 0, False: 0]
  ------------------
  486|      0|						TAILQ_INSERT_TAIL(
  ------------------
  |  Branch (486:7): [Folded, False: 0]
  ------------------
  487|      0|						    &oport->p_chassis->c_mgmt, mgmt,
  488|      0|						    m_entries);
  489|      0|					else
  490|      0|						free(mgmt);
  491|      0|				}
  492|      0|			}
  493|       |			/* We discard the remaining frame */
  494|      5|			goto malformed;
  495|      5|		}
  496|       |#  else
  497|       |		if (gotvlans) goto malformed;
  498|       |#  endif
  499|    158|		log_warnx("edp",
  500|    158|		    "some mandatory tlv are missing for frame received on %s",
  501|    158|		    hardware->h_ifname);
  502|    158|		goto malformed;
  503|    163|	}
  504|     40|	*newchassis = chassis;
  505|     40|	*newport = port;
  506|     40|	return 1;
  507|       |
  508|    342|malformed:
  509|    342|#  ifdef ENABLE_DOT1
  510|    342|	free(lvlan);
  511|    342|#  endif
  512|    342|	lldpd_chassis_cleanup(chassis, 1);
  513|    342|	lldpd_port_cleanup(port, 1);
  514|    342|	free(port);
  515|    342|	return -1;
  516|    203|}

lldpd_chassis_mgmt_cleanup:
   26|    382|{
   27|    382|	struct lldpd_mgmt *mgmt, *mgmt_next;
   28|       |
   29|    382|	log_debug("alloc", "cleanup management addresses for chassis %s",
   30|    382|	    chassis->c_name ? chassis->c_name : "(unknown)");
  ------------------
  |  Branch (30:6): [True: 63, False: 319]
  ------------------
   31|       |
   32|    640|	for (mgmt = TAILQ_FIRST(&chassis->c_mgmt); mgmt != NULL; mgmt = mgmt_next) {
  ------------------
  |  Branch (32:45): [True: 258, False: 382]
  ------------------
   33|    258|		mgmt_next = TAILQ_NEXT(mgmt, m_entries);
   34|    258|		free(mgmt);
   35|    258|	}
   36|       |	TAILQ_INIT(&chassis->c_mgmt);
  ------------------
  |  Branch (36:2): [Folded, False: 382]
  ------------------
   37|    382|}
lldpd_chassis_cleanup:
   41|    382|{
   42|    382|	lldpd_chassis_mgmt_cleanup(chassis);
   43|    382|	log_debug("alloc", "cleanup chassis %s",
   44|    382|	    chassis->c_name ? chassis->c_name : "(unknown)");
  ------------------
  |  Branch (44:6): [True: 63, False: 319]
  ------------------
   45|    382|#ifdef ENABLE_LLDPMED
   46|    382|	free(chassis->c_med_hw);
   47|    382|	free(chassis->c_med_sw);
   48|    382|	free(chassis->c_med_fw);
   49|    382|	free(chassis->c_med_sn);
   50|    382|	free(chassis->c_med_manuf);
   51|    382|	free(chassis->c_med_model);
   52|    382|	free(chassis->c_med_asset);
   53|    382|#endif
   54|    382|	free(chassis->c_id);
   55|    382|	free(chassis->c_name);
   56|    382|	free(chassis->c_descr);
   57|    382|	if (all) free(chassis);
  ------------------
  |  Branch (57:6): [True: 382, False: 0]
  ------------------
   58|    382|}
lldpd_vlan_cleanup:
   63|    382|{
   64|    382|	struct lldpd_vlan *vlan, *vlan_next;
   65|    751|	for (vlan = TAILQ_FIRST(&port->p_vlans); vlan != NULL; vlan = vlan_next) {
  ------------------
  |  Branch (65:43): [True: 369, False: 382]
  ------------------
   66|    369|		free(vlan->v_name);
   67|    369|		vlan_next = TAILQ_NEXT(vlan, v_entries);
   68|    369|		free(vlan);
   69|    369|	}
   70|       |	TAILQ_INIT(&port->p_vlans);
  ------------------
  |  Branch (70:2): [Folded, False: 382]
  ------------------
   71|    382|	port->p_pvid = 0;
   72|    382|}
lldpd_ppvid_cleanup:
   76|    382|{
   77|    382|	struct lldpd_ppvid *ppvid, *ppvid_next;
   78|    382|	for (ppvid = TAILQ_FIRST(&port->p_ppvids); ppvid != NULL; ppvid = ppvid_next) {
  ------------------
  |  Branch (78:45): [True: 0, False: 382]
  ------------------
   79|      0|		ppvid_next = TAILQ_NEXT(ppvid, p_entries);
   80|      0|		free(ppvid);
   81|      0|	}
   82|       |	TAILQ_INIT(&port->p_ppvids);
  ------------------
  |  Branch (82:2): [Folded, False: 382]
  ------------------
   83|    382|}
lldpd_pi_cleanup:
   87|    382|{
   88|    382|	struct lldpd_pi *pi, *pi_next;
   89|    382|	for (pi = TAILQ_FIRST(&port->p_pids); pi != NULL; pi = pi_next) {
  ------------------
  |  Branch (89:40): [True: 0, False: 382]
  ------------------
   90|      0|		free(pi->p_pi);
   91|      0|		pi_next = TAILQ_NEXT(pi, p_entries);
   92|      0|		free(pi);
   93|      0|	}
   94|       |	TAILQ_INIT(&port->p_pids);
  ------------------
  |  Branch (94:2): [Folded, False: 382]
  ------------------
   95|    382|}
lldpd_custom_list_cleanup:
  141|    382|{
  142|    382|	struct lldpd_custom *custom, *custom_next;
  143|    382|	for (custom = TAILQ_FIRST(&port->p_custom_list); custom != NULL;
  ------------------
  |  Branch (143:51): [True: 0, False: 382]
  ------------------
  144|    382|	     custom = custom_next) {
  145|      0|		custom_next = TAILQ_NEXT(custom, next);
  146|      0|		free(custom->oui_info);
  147|      0|		free(custom);
  148|      0|	}
  149|       |	TAILQ_INIT(&port->p_custom_list);
  ------------------
  |  Branch (149:2): [Folded, False: 382]
  ------------------
  150|    382|}
lldpd_port_cleanup:
  196|    382|{
  197|    382|#ifdef ENABLE_LLDPMED
  198|    382|	int i;
  199|    382|	if (all)
  ------------------
  |  Branch (199:6): [True: 382, False: 0]
  ------------------
  200|  1.52k|		for (i = 0; i < LLDP_MED_LOCFORMAT_LAST; i++)
  ------------------
  |  |  301|  1.52k|#define LLDP_MED_LOCFORMAT_LAST LLDP_MED_LOCFORMAT_ELIN
  |  |  ------------------
  |  |  |  |  300|  1.52k|#define LLDP_MED_LOCFORMAT_ELIN 3
  |  |  ------------------
  ------------------
  |  Branch (200:15): [True: 1.14k, False: 382]
  ------------------
  201|  1.14k|			free(port->p_med_location[i].data);
  202|    382|#endif
  203|    382|#ifdef ENABLE_DOT1
  204|    382|	lldpd_vlan_cleanup(port);
  205|    382|	lldpd_ppvid_cleanup(port);
  206|    382|	lldpd_pi_cleanup(port);
  207|    382|#endif
  208|       |	/* will set these to NULL so we don't free wrong memory */
  209|       |
  210|    382|	if (all) {
  ------------------
  |  Branch (210:6): [True: 382, False: 0]
  ------------------
  211|    382|		free(port->p_id);
  212|    382|		port->p_id = NULL;
  213|    382|		free(port->p_descr);
  214|    382|		port->p_descr = NULL;
  215|    382|		free(port->p_lastframe);
  216|    382|		if (port->p_chassis) { /* chassis may not have been attributed, yet */
  ------------------
  |  Branch (216:7): [True: 0, False: 382]
  ------------------
  217|      0|			port->p_chassis->c_refcount--;
  218|      0|			port->p_chassis = NULL;
  219|      0|		}
  220|    382|		free(port->p_vlan_advertise_pattern);
  221|       |		port->p_vlan_advertise_pattern = NULL;
  222|    382|#ifdef ENABLE_CUSTOM
  223|    382|		lldpd_custom_list_cleanup(port);
  224|    382|#endif
  225|    382|	}
  226|    382|}

log_register:
   64|    382|{
   65|    382|	logh = cb;
   66|    382|}
log_warnx:
  214|    261|{
  215|    261|	va_list ap;
  216|       |
  217|    261|	va_start(ap, emsg);
  218|    261|	vlog(LOG_WARNING, token, emsg, ap);
  219|       |	va_end(ap);
  220|    261|}
log_info:
  224|     51|{
  225|     51|	va_list ap;
  226|       |
  227|     51|	if (use_syslog || debug > 0 || logh) {
  ------------------
  |  Branch (227:6): [True: 0, False: 51]
  |  Branch (227:20): [True: 0, False: 51]
  |  Branch (227:33): [True: 51, False: 0]
  ------------------
  228|     51|		va_start(ap, emsg);
  229|     51|		vlog(LOG_INFO, token, emsg, ap);
  230|       |		va_end(ap);
  231|     51|	}
  232|     51|}
log_debug:
  247|  3.62k|{
  248|  3.62k|	va_list ap;
  249|       |
  250|  3.62k|	if ((debug > 1 && log_debug_accept_token(token)) || logh) {
  ------------------
  |  Branch (250:7): [True: 0, False: 3.62k]
  |  Branch (250:20): [True: 0, False: 0]
  |  Branch (250:54): [True: 3.62k, False: 0]
  ------------------
  251|  3.62k|		va_start(ap, emsg);
  252|  3.62k|		vlog(LOG_DEBUG, token, emsg, ap);
  253|       |		va_end(ap);
  254|  3.62k|	}
  255|  3.62k|}
log.c:vlog:
  154|  3.93k|{
  155|  3.93k|	if (logh) {
  ------------------
  |  Branch (155:6): [True: 3.93k, False: 0]
  ------------------
  156|  3.93k|		char *result = NULL;
  157|  3.93k|		if (vasprintf(&result, fmt, ap) != -1) {
  ------------------
  |  Branch (157:7): [True: 3.93k, False: 0]
  ------------------
  158|  3.93k|			logh(pri, result);
  159|  3.93k|			free(result);
  160|  3.93k|			return;
  161|  3.93k|		}
  162|       |		/* Otherwise, abort. We don't know if "ap" is still OK. We could
  163|       |		 * have made a copy, but this is too much overhead for a
  164|       |		 * situation that shouldn't happen. */
  165|      0|		return;
  166|  3.93k|	}
  167|       |
  168|       |	/* Log to syslog if requested */
  169|      0|	if (use_syslog) {
  ------------------
  |  Branch (169:6): [True: 0, False: 0]
  ------------------
  170|      0|		va_list ap2;
  171|      0|		va_copy(ap2, ap);
  172|      0|		vsyslog(pri, fmt, ap2);
  173|      0|		va_end(ap2);
  174|      0|	}
  175|       |
  176|       |	/* Log to standard error in all cases. Format the caller's message
  177|       |	 * first so it is not re-interpreted as a format string by the
  178|       |	 * surrounding fprintf. */
  179|      0|	char *body = NULL;
  180|      0|	if (vasprintf(&body, fmt, ap) == -1) body = NULL;
  ------------------
  |  Branch (180:6): [True: 0, False: 0]
  ------------------
  181|      0|	fprintf(stderr, "%s %s%s%s]%s %s\n", date(), translate(STDERR_FILENO, pri),
  182|      0|	    token ? "/" : "", token ? token : "",
  ------------------
  |  Branch (182:6): [True: 0, False: 0]
  |  Branch (182:24): [True: 0, False: 0]
  ------------------
  183|      0|	    isatty(STDERR_FILENO) ? "\033[0m" : "", body ? body : fmt);
  ------------------
  |  Branch (183:6): [True: 0, False: 0]
  |  Branch (183:46): [True: 0, False: 0]
  ------------------
  184|      0|	free(body);
  185|       |	fflush(stderr);
  186|      0|}

donothing:
   24|  3.93k|void donothing(int pri, const char *msg) {};
LLVMFuzzerTestOneInput:
   28|    408|{
   29|    408|	if (Size < kMinInputLength || Size > kMaxInputLength) {
  ------------------
  |  |   20|    816|#define kMinInputLength 5
  ------------------
              	if (Size < kMinInputLength || Size > kMaxInputLength) {
  ------------------
  |  |   21|    404|#define kMaxInputLength 2048
  ------------------
  |  Branch (29:6): [True: 4, False: 404]
  |  Branch (29:32): [True: 22, False: 382]
  ------------------
   30|     26|		return 1;
   31|     26|	}
   32|       |
   33|    382|	struct lldpd cfg;
   34|    382|	cfg.g_config.c_mgmt_pattern = NULL;
   35|    382|	cfg.g_config.c_tx_hold = LLDPD_TX_HOLD;
  ------------------
  |  |   68|    382|#define LLDPD_TX_HOLD 4
  ------------------
   36|       |
   37|    382|	struct lldpd_chassis *nchassis = NULL;
   38|    382|	struct lldpd_port *nport = NULL;
   39|    382|	struct lldpd_hardware hardware;
   40|    382|	TAILQ_INIT(&hardware.h_rports);
  ------------------
  |  Branch (40:2): [Folded, False: 382]
  ------------------
   41|    382|	log_register(donothing);
   42|       |
   43|    382|	edp_decode(&cfg, (char *)Data, Size, &hardware, &nchassis, &nport);
   44|       |
   45|    382|	if (!nchassis || !nport) {
  ------------------
  |  Branch (45:6): [True: 342, False: 40]
  |  Branch (45:19): [True: 0, False: 40]
  ------------------
   46|    342|		return 1;
   47|    342|	}
   48|       |
   49|     40|	lldpd_port_cleanup(nport, 1);
   50|     40|	free(nport);
   51|     40|	lldpd_chassis_cleanup(nchassis, 1);
   52|       |
   53|     40|	return 0;
   54|    382|}

