Skip to content
Snippets Groups Projects
Commit cc8ec92e authored by Mathias Kreider's avatar Mathias Kreider
Browse files

proper tx packet length check implemented

parent 68374db8
Branches
Tags
No related merge requests found
...@@ -146,7 +146,7 @@ port( ...@@ -146,7 +146,7 @@ port(
signal conv_A : wb32_slave_out; --! signal conv_A : wb32_slave_out; --!
-- main FSM -- main FSM
type st is (IDLE, CALC_CHKSUM, WAIT_SEND_REQ, PREP_ETH, ETH, IPV4, UDP, HDR_SEND, PAYLOAD_SEND, PADDING, WAIT_IFGAP); type st is (IDLE, CALC_CHKSUM, WAIT_SEND_REQ, PREP_ETH, ETH, IPV4, UDP, HDR_SEND, PAYLOAD_SEND, PADDING, WAIT_IFGAP, ERROR);
signal state : st := IDLE; signal state : st := IDLE;
signal ETH_TX : ETH_HDR; signal ETH_TX : ETH_HDR;
...@@ -478,6 +478,8 @@ begin ...@@ -478,6 +478,8 @@ begin
if(byte_count < c_ETH_FRAME_MIN_END) then if(byte_count < c_ETH_FRAME_MIN_END) then
state <= PADDING; state <= PADDING;
state_mux <= PADDING; state_mux <= PADDING;
elsif(byte_count /= to_integer(unsigned(IPV4_TX.TOL)+14)) then
state <= ERROR;
else else
state <= WAIT_IFGAP; state <= WAIT_IFGAP;
state_mux <= NONE; state_mux <= NONE;
...@@ -498,6 +500,8 @@ begin ...@@ -498,6 +500,8 @@ begin
state <= IDLE; state <= IDLE;
--end if; --end if;
when ERROR => state <= IDLE;
report ("TX: ERROR - Wrong packet size. Expected " & integer'image(byte_count) & " found " & integer'image(to_integer(unsigned(IPV4_TX.TOL)+14))) severity error;
when others => state <= IDLE; when others => state <= IDLE;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment