Hi, The global variable tun_fwd_ifnames is used in both session.c and serverloop.c. This means one of them has to be marked as extern. Most compilers will ignore such errors, but it's not correct. E.g. in gcc you can enable a stricter handling of global variables with -fno-common. See attached patch, which will mark it as extern in sessions.c. (the other variables in that block are already marked extern, so it seems fitting.) -- Hanno B?ck https://hboeck.de/ mail/jabber: hanno at hboeck.de GPG: FE73757FA60E4E21B937579FA5880072BBB51E42 -------------- next part -------------- A non-text attachment was scrubbed... Name: openssh-fix-extern-no-common.diff Type: text/x-patch Size: 431 bytes Desc: not available URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20190112/d818a992/attachment.bin>
Damien Miller
2019-Jan-17 04:45 UTC
[patch] mark one instance of tun_fwd_ifnames as extern
On Sat, 12 Jan 2019, Hanno B?ck wrote:> Hi, > > The global variable tun_fwd_ifnames is used in both session.c and > serverloop.c. > > This means one of them has to be marked as extern. Most compilers will > ignore such errors, but it's not correct. E.g. in gcc you can enable a > stricter handling of global variables with -fno-common. > > See attached patch, which will mark it as extern in sessions.c. (the > other variables in that block are already marked extern, so it seems > fitting.)Committed and added -fno-common to my local build flags :) -d