Skip to content

issue in ‘data_generation/pretrain_data_gen.py’ #10

Description

@fankaisheng

In line 161:

packet_direction = [] 
    feature_result = extract(label_pcap)
    for key in feature_result.keys():
        value = feature_result[key]
        packet_direction = [x // abs(x) for x in value.ip_lengths]

    if len(packet_direction) == len(packets):
        .....

It seems packet_direction is supposed to be a list that stores the direction sequence for every session in the input pcap.

However, inside the for loop over sessions the anonymous function packet_direction = [x // abs(x) for x in value.ip_lengths] overwrites packet_direction each time, so only the last session’s direction sequence is kept.

This makes the data processing impossible to work correctly if len(packet_direction) == len(packets) — can this code really reproduce the results correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions