Skip to content

Commit

Permalink
fix odr-violations
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Koeppe committed Jan 2, 2023
1 parent 39fe66c commit 91cca91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions plug-ins/rand_flood/rand_flood.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ struct arp_eth_header {
};

#define FAKE_PCK_LEN sizeof(struct eth_header)+sizeof(struct arp_header)+sizeof(struct arp_eth_header)
struct packet_object fake_po;
char fake_pck[FAKE_PCK_LEN];
struct packet_object flood_fake_po;
char flood_fake_pck[FAKE_PCK_LEN];


/* protos */
Expand Down Expand Up @@ -146,7 +146,7 @@ EC_THREAD_FUNC(flooder)
srandom(seed.tv_sec ^ seed.tv_usec);

/* Create a fake ARP packet */
heth = (struct eth_header *)fake_pck;
heth = (struct eth_header *)flood_fake_pck;
harp = (struct arp_header *)(heth + 1);

heth->proto = htons(LL_TYPE_ARP);
Expand All @@ -156,7 +156,7 @@ EC_THREAD_FUNC(flooder)
harp->ar_pln = 4;
harp->ar_op = htons(ARPOP_REQUEST);

packet_create_object(&fake_po, (u_char*)fake_pck, FAKE_PCK_LEN);
packet_create_object(&flood_fake_po, (u_char*)flood_fake_pck, FAKE_PCK_LEN);

/* init the thread and wait for start up */
ec_thread_init();
Expand All @@ -181,7 +181,7 @@ EC_THREAD_FUNC(flooder)
memcpy(heth->sha, MACS, ETH_ADDR_LEN);

/* Send on the wire and wait */
send_to_L2(&fake_po);
send_to_L2(&flood_fake_po);

ec_usleep(EC_GBL_CONF->port_steal_send_delay);
}
Expand Down
14 changes: 7 additions & 7 deletions plug-ins/stp_mangler/stp_mangler.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ struct stp_header
};

#define FAKE_PCK_LEN 60
struct packet_object fake_po;
char fake_pck[FAKE_PCK_LEN];
struct packet_object stp_fake_po;
char stp_fake_pck[FAKE_PCK_LEN];


/* protos */
Expand Down Expand Up @@ -150,9 +150,9 @@ EC_THREAD_FUNC(mangler)
(void) EC_THREAD_PARAM;

/* Avoid crappy compiler alignment :( */
heth = (struct eth_header *)fake_pck;
hllc = (struct llc_header *)(fake_pck + 14);
hstp = (struct stp_header *)(fake_pck + 22);
heth = (struct eth_header *)stp_fake_pck;
hllc = (struct llc_header *)(stp_fake_pck + 14);
hstp = (struct stp_header *)(stp_fake_pck + 22);

/* Create a fake STP packet */
heth->proto = htons(0x0026);
Expand All @@ -172,7 +172,7 @@ EC_THREAD_FUNC(mangler)
hstp->hello_time = htons_inv(2);
hstp->forward_delay = htons_inv(15);

packet_create_object(&fake_po, (u_char*)fake_pck, FAKE_PCK_LEN);
packet_create_object(&stp_fake_po, (u_char*)stp_fake_pck, FAKE_PCK_LEN);

/* init the thread and wait for start up */
ec_thread_init();
Expand All @@ -181,7 +181,7 @@ EC_THREAD_FUNC(mangler)
CANCELLATION_POINT();

/* Send on the wire and wait */
send_to_L2(&fake_po);
send_to_L2(&stp_fake_po);
ec_usleep(SEC2MICRO(1));
}

Expand Down

0 comments on commit 91cca91

Please sign in to comment.