Skip to content

There seems to be a bug in the ipv4 source selection logic #821

Open
@prepaser

Description

@prepaser

The main.c has the following code.

                /*
                 * SYN-COOKIE LOGIC
                 *  Figure out the source IP/port, and the SYN cookie
                 */
                if (src.ipv4_mask > 1 || src.port_mask > 1) {
                    uint64_t ck = syn_cookie_ipv4((unsigned)(i+repeats),
                                            (unsigned)((i+repeats)>>32),
                                            (unsigned)xXx, (unsigned)(xXx>>32),
                                            entropy);
                    port_me = src.port + (ck & src.port_mask);
                    ip_me = src.ipv4 + ((ck>>16) & src.ipv4_mask);
                } else {
                    ip_me = src.ipv4;
                    port_me = src.port;
                }

However, src.ipv4_mask is:

    src->ipv4_mask = ifsrc->ipv4.last - ifsrc->ipv4.first;

If the adapter-ip is two IPs, source range selection does not work. Only the first IP will work.

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