Skip to content

Commit

Permalink
libknet: fix memmove offset and make it simpler
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Oct 6, 2012
1 parent ee97b5e commit ad739f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libknet/handle.c
Expand Up @@ -306,7 +306,7 @@ static void _handle_tap_to_links(knet_handle_t knet_h)
(dst_host->active_link_entries > 1)) {
uint8_t cur_link_id = dst_host->active_links[0];

memmove(&dst_host->active_links[0], &dst_host->active_links[1], (dst_host->active_link_entries - 2));
memmove(&dst_host->active_links[0], &dst_host->active_links[1], KNET_MAX_LINK - 1);
dst_host->active_links[dst_host->active_link_entries - 1] = cur_link_id;

break;
Expand Down Expand Up @@ -336,7 +336,7 @@ static void _handle_tap_to_links(knet_handle_t knet_h)
(dst_host->active_link_entries > 1)) {
uint8_t cur_link_id = dst_host->active_links[0];

memmove(&dst_host->active_links[0], &dst_host->active_links[1], (dst_host->active_link_entries - 2));
memmove(&dst_host->active_links[0], &dst_host->active_links[1], KNET_MAX_LINK - 1);
dst_host->active_links[dst_host->active_link_entries - 1] = cur_link_id;

break;
Expand Down

0 comments on commit ad739f1

Please sign in to comment.