src/lib/packet_parser.c in trema-0.3.19 vs src/lib/packet_parser.c in trema-0.3.20

- old
+ new

@@ -117,11 +117,11 @@ } } static void -parse_arp( buffer *buf ) { +parse_arp( buffer *buf, uint32_t format ) { assert( buf != NULL ); packet_info *packet_info = buf->user_data; void *ptr = packet_info->l3_header; assert( ptr != NULL ); @@ -142,11 +142,11 @@ memcpy( packet_info->arp_sha, arp_header->sha, ETH_ADDRLEN ); packet_info->arp_spa = ntohl( arp_header->sip ); memcpy( packet_info->arp_tha, arp_header->tha, ETH_ADDRLEN ); packet_info->arp_tpa = ntohl( arp_header->tip ); - packet_info->format |= NW_ARP; + packet_info->format |= format; } static void parse_ipv4( buffer *buf ) { @@ -439,10 +439,15 @@ // Parse the L3 header. switch ( packet_info->eth_type ) { case ETH_ETHTYPE_ARP: packet_info->l3_header = packet_info->l2_payload; - parse_arp( buf ); + parse_arp( buf, NW_ARP ); + break; + + case ETH_ETHTYPE_RARP: + packet_info->l3_header = packet_info->l2_payload; + parse_arp( buf, NW_RARP ); break; case ETH_ETHTYPE_IPV4: packet_info->l3_header = packet_info->l2_payload; parse_ipv4( buf );