Skip to content

Commit

Permalink
net: don't allow state-changing packets in net channels
Browse files Browse the repository at this point in the history
Let them take the normal path for not to avoid complicating the locking
rules.

Reviewed-by: Nadav Har'El <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
avikivity committed Feb 9, 2014
1 parent 1e4c994 commit 2f2d7a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/net_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ net_channel* classifier::classify_ipv4_tcp(mbuf* m)
auto dst_addr = ip_hdr->ip_dst;
h += ip_size;
auto tcp_hdr = reinterpret_cast<tcphdr*>(h);
if (tcp_hdr->th_flags & (TH_SYN | TH_FIN | TH_RST)) {
return nullptr;
}
auto src_port = ntohs(tcp_hdr->th_sport);
auto dst_port = ntohs(tcp_hdr->th_dport);
auto id = ipv4_tcp_conn_id{src_addr, dst_addr, src_port, dst_port};
Expand Down

0 comments on commit 2f2d7a9

Please sign in to comment.