On Jul 1, 2017 9:01 AM, "Kirspel, Kevin" <kevin-kirs...@idexx.com> wrote:
I get a crash when running the tcpdump command in LIBBSD. It is due to the following structure struct stp_bpdu_ { u_int8_t protocol_id[2]; u_int8_t protocol_version; u_int8_t bpdu_type; u_int8_t flags; u_int8_t root_id[8]; u_int8_t root_path_cost[4]; u_int8_t bridge_id[8]; u_int8_t port_id[2]; u_int8_t message_age[2]; u_int8_t max_age[2]; u_int8_t hello_time[2]; u_int8_t forward_delay[2]; u_int8_t v1_length; }; In the code, there is an access to the port_id field as follows: EXTRACT_16BITS(&stp_bpdu->port_id). EXTRACT_16BITS calls ntohs() . Since the address of “&stp_bpdu->port_id” is at an odd word (16 bit) boundary, an exception is generated. What is the correct way to fix this? I was going to update EXTRACT_16BITS to check for an odd boundary and fix it up before calling ntohs(). There should be a bit in cp15 which determines is unaligned accesses are enabled. Should be examples in other BSPs --joel Kevin Kirspel Electrical Engineer - Sr. Staff Idexx Roswell 235 Hembree Park Drive Roswell GA 30076 Tel: (770)-510-4444 ext. 81642 <(770)%20510-4444> Direct: (770)-688-1642 <(770)%20688-1642> Fax: (770)-510-4445 <(770)%20510-4445> _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel