Skip to content

Segmentation Fault in function mbuf_sort #45

@FoyetFan

Description

@FoyetFan

When data packets need to be sorted, segment errors will be triggered in function mbuf_sort.
I think it should be like this, and it does work.

mbuf_sort(){
...
if ((*next)->frag_cnt < (*curr)->frag_cnt) 
{ 
    // swap pointers for curr and curr->next 
    schc_mbuf_t *temp; 
    temp = *curr; 
    *curr = *next; 
   *next = temp; 

    temp = (*curr)->next; 
    (*curr)->next = (*next)->next;
    (*next)->next = temp;
    curr = &(*curr)->next; swapped = 1; 
}
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions