1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-15 20:05:34 +02:00

passt: Shrink binary size by dropping static initialisers

...from 11MiB to 155KiB for 'make avx2', 95KiB with -Os and stripped.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-05 21:15:01 +02:00
parent a26722b875
commit 16f4b983de
4 changed files with 73 additions and 53 deletions

View file

@ -54,6 +54,7 @@
#include "util.h"
#include "passt.h"
#include "dhcp.h"
#include "dhcpv6.h"
#include "icmp.h"
#include "tcp.h"
@ -376,8 +377,6 @@ int main(int argc, char **argv)
}
sock_probe_mem(&c);
proto_update_l2_buf(c.mac_guest, c.mac, &c.addr4);
tap_sock_init(&c);
clock_gettime(CLOCK_MONOTONIC, &now);
@ -386,6 +385,11 @@ int main(int argc, char **argv)
(!c.no_tcp && tcp_sock_init(&c, &now)))
exit(EXIT_FAILURE);
proto_update_l2_buf(c.mac_guest, c.mac, &c.addr4);
if (c.v4 && !c.no_dhcp)
dhcp_init();
if (c.v6 && !c.no_dhcpv6)
dhcpv6_init(&c);