noxrepo / nox

The NOX Controller
Other
139 stars 85 forks source link

bugs in ofp_match::from_packet #22

Closed sharkdtu closed 10 years ago

sharkdtu commented 10 years ago

in the function ofp_match::from_packet(): ............... ............... else if (nwproto() == ip::proto::ICMP) { const icmp_header* icmp = cast_check(packet); if (!icmp) return; packet = packet + sizeof(icmp_header); tp_src(ntohs(icmp->icmp_type)); tp_dst(ntohs(icmp->icmp_code)); } .............. the type of "icmp->icmp_type" and "icmp->icmp_code" are uint8_t, they shoud not be converted to host byte order by calling "ntohs". simply fix it like that: tp_src(icmp->icmp_type); tp_dst(icmp->icmp_code);

tootoonchian commented 10 years ago

Fixed. Thanks!