Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[stp] Fix interpretaton of hello time
Times in STP packets are expressed in units of 1/256 of a second.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jun 25, 2015
1 parent fb28c4a commit 94dbfb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/stp.c
Expand Up @@ -65,7 +65,7 @@ static int stp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
const void *ll_source __unused,
unsigned int flags __unused ) {
struct stp_bpdu *stp;
unsigned int timeout;
unsigned int hello;
int rc;

/* Sanity check */
Expand Down Expand Up @@ -110,8 +110,8 @@ static int stp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
"forwarding\n",
netdev->name, eth_ntoa ( stp->sender.mac ),
ntohs ( stp->port ), stp->flags );
timeout = ( ntohs ( stp->hello ) * TICKS_PER_SEC * 2 );
netdev_link_block ( netdev, timeout );
hello = ( ( ntohs ( stp->hello ) * TICKS_PER_SEC ) / 256 );
netdev_link_block ( netdev, ( hello * 2 ) );
rc = -ENETUNREACH;
goto done;
}
Expand Down

0 comments on commit 94dbfb4

Please sign in to comment.