From: Markus Armbruster Date: Tue, 8 Jan 2013 17:54:20 +0000 (+0100) Subject: Really fix accepting connections from "long" IPv6 address X-Git-Tag: v4.3.31~112 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=3a7d7fa;hp=75619c37321bc669d18304fe670a63cdfe9c334e Really fix accepting connections from "long" IPv6 address Commit ee01ac19 (v4.3.23) enlarged player member hostaddr from 32 to 46 characters, but missed natstr member nat_hostaddr. player_main() copies hostaddr to nat_hostaddr. Can overrun the destination, but fortunately just into nat_hostname. Impact: * Can makes praddr() print only a suffix of the address. Used by play command, for player messages during login and logout, and for logging. * Can make player_main()'s test for "same address as last time" fail, causing extra "Last connection" messages. * Matching against econfig key privip is not affected. * Journal event login is not affected. --- diff --git a/include/nat.h b/include/nat.h index 74c7ed665..fd01289e7 100644 --- a/include/nat.h +++ b/include/nat.h @@ -93,7 +93,7 @@ struct natstr { enum nat_status nat_stat; char nat_cnam[20]; /* country name */ char nat_pnam[20]; /* representative */ - char nat_hostaddr[32]; /* host addr of last user */ + char nat_hostaddr[46]; /* host addr of last user */ char nat_hostname[512]; /* hostname of last user, may be empty */ char nat_userid[32]; /* userid of last user, may be empty */ coord nat_xcap, nat_ycap; /* cap location in abs coords */