diff options
| author | Matt Hunter <m@lfurio.us> | 2025-09-14 11:52:39 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2025-09-28 22:45:59 -0400 |
| commit | 2d6d14a87afdb0eb4a4d81fd981cd825cd2c7824 (patch) | |
| tree | d53276bd36eb1b0980722274da420b3698ed569a /sockaddr_127-0-0-1_1337.bin | |
| parent | 37243a782b0fe4828e7b2480ea600b126d9c512a (diff) | |
| download | lace-2d6d14a87afdb0eb4a4d81fd981cd825cd2c7824.tar.gz lace-2d6d14a87afdb0eb4a4d81fd981cd825cd2c7824.zip | |
Statically define socket endpoint
Instead of opening and reading a sockaddr_in struct from an external
file at runtime, define this data in the executable with constants.
Furthermore, arrange to store this data in a yet unused portion of the
main ELF header so it effectively consumes no additional space. It
overlaps the ELF "shoff" and "flags", and the program header "align"
fields.
The full size of struct sockaddr_in is actually 16 bytes, but the last 8
bytes are padding, and failing to zero them out appears to have no
adverse effect on behavior. So this padding area will just be populated
by the next few fields in the ELF header, interpreted as garbage.
In the program code, remove the initial syscalls for open() and read()
and their associated error checking.
Also remove the error check after connect(), as the program will
properly exit without performing any IO without it. Going forward, we
make no guarantees about lace's exit status.
Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to 'sockaddr_127-0-0-1_1337.bin')
| -rw-r--r-- | sockaddr_127-0-0-1_1337.bin | bin | 16 -> 0 bytes |
1 files changed, 0 insertions, 0 deletions
diff --git a/sockaddr_127-0-0-1_1337.bin b/sockaddr_127-0-0-1_1337.bin Binary files differdeleted file mode 100644 index 8078d06..0000000 --- a/sockaddr_127-0-0-1_1337.bin +++ /dev/null |
