lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALoOobMCio0GtxerOpXwB-Bxf-cKnLotPBA69oPC-6CWDfyPyg@mail.gmail.com>
Date:	Fri, 8 Jun 2012 22:45:20 -0700
From:	Paul Pluzhnikov <ppluzhnikov@...gle.com>
To:	David Miller <davem@...emloft.net>
Cc:	jkosina@...e.cz, netdev@...r.kernel.org
Subject: Re: [PATCH torvalds/linux.git] Make linux/tcp.h C++ friendly (trivial)

On Fri, Jun 8, 2012 at 10:17 PM, David Miller <davem@...emloft.net> wrote:
> From: Paul Pluzhnikov <ppluzhnikov@...gle.com>
> Date: Fri, 8 Jun 2012 21:14:19 -0700
>
>> I thought the patch has been applied, and stopped pinging it.
>> But it appears that it never did get applied :-(
>
> Your submission is not properly formed, you need to post this as a
> fresh email with proper commit message and signoffs.
>
> Please read Documentation/SubmittingPatches if you want us to
> seriously consider this change.

Here is the original message I sent to <trivial@...nel.org> on
Thu, Dec 29, 2011 at 10:30 AM:

-----------------------------------------
Greetings,

Using linux/tcp.h from C++ results in:

cat t.cc
#include <linux/tcp.h>
int main() { }

g++ -c t.cc

In file included from t.cc:1:
/usr/include/linux/tcp.h:72: error: '__u32 __fswab32(__u32)' cannot
appear in a constant-expression
/usr/include/linux/tcp.h:72: error: a function call cannot appear in a
constant-expression
...

Attached trivial patch fixes this problem.

Tested:
- the t.cc above compiles with g++ and
- the following program generates the same output before/after
 the patch:

#include <linux/tcp.h>
#include <stdio.h>

int main ()
{
#define P(a) printf("%s: %08x\n", #a, (int)a)
 P(TCP_FLAG_CWR);
 P(TCP_FLAG_ECE);
 P(TCP_FLAG_URG);
 P(TCP_FLAG_ACK);
 P(TCP_FLAG_PSH);
 P(TCP_FLAG_RST);
 P(TCP_FLAG_SYN);
 P(TCP_FLAG_FIN);
 P(TCP_RESERVED_BITS);
 P(TCP_DATA_OFFSET);
#undef P
 return 0;
}

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@...gle.com>


Thanks,

P.S. Google has blanket copyright assignment to FSF.
--
Paul Pluzhnikov

View attachment "linux-tcp_h-patch-20111229.txt" of type "text/plain" (1255 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ