Custom kernel with PIPEX without IPSEC failed to compile

2014-06-25 Thread Ivan Solonin
Sender: owner-m...@openbsd.org
On-Behalf-Of: iss...@gmail.com
Subject: Custom kernel with PIPEX without IPSEC failed to compile
Message-Id: op.xhul9xnc16z...@ic0.lan.rlan
Recipient: adam.atkin...@damovo.com
Received: from Mail2.damovo.com (109.204.121.44)
by UK001B237.d.grp (10.8.1.9) with Microsoft SMTP Server (TLS) id 
14.2.318.4; Sun, 22 Jun 2014 10:40:09 +0100
Received: from cluster-a.mailcontrol.com (85.115.52.190)
by Mail2.damovo.com (109.204.121.44) with Microsoft SMTP Server (TLS) 
id 14.2.318.4; Sun, 22 Jun 2014 10:40:08 +0100
Received: from shear.ucar.edu (lists.openbsd.org [192.43.244.163])
by rly16a.srv.mailcontrol.com (MailControl) with ESMTP id 
s5M9e1mQ004556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 
verify=FAIL)
for adam.atkin...@damovo.com; Sun, 22 Jun 2014 10:40:03 +0100
Received: from openbsd.org (localhost [127.0.0.1])
by shear.ucar.edu (8.14.5/8.14.5) with ESMTP id s5M9n3SG010758
for adam.atkin...@damovo.com; Sun, 22 Jun 2014 03:49:04 -0600 (MDT)
Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com 
[209.85.217.173])
by shear.ucar.edu (8.14.5/8.14.5) with ESMTP id s5M9HGgX002900 
(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=FAIL)
for misc@openbsd.org; Sun, 22 Jun 2014 03:17:17 -0600 (MDT)
Received: by mail-lb0-f173.google.com with SMTP id s7so3327965lbd.4
for misc@openbsd.org; Sun, 22 Jun 2014 02:07:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 
h=content-type:to:date:subject:mime-version:content-transfer-encoding 
:from:message-id:user-agent; bh=5itrSSvalil1YjCfpKMMTV6VI5xoRvl1Z8P6slsuYdI=; 
b=Qp+4mg7OCqow6TUWZJ4iHySvVa6ijCavGpfSM1rAfg00QXjXFl7DmWhGOq3IvVH1YC 
xUJ0vA5xZAnri06ZMsylhDOLt9qyfhrgZdTUBIf2wGZSCyb4DGgoZ1eZFQLLsUhErTHG 
XCpRpyRC7nVVsgU6rsNiFr9kFfWLcQuAo/5TxzQsIT9uJT+qavYB6qTzpMdX9OC3vCOb 
pMHznhehkHeeegfudSUUuPBRGssteE6yJ0qlu6JLvVAJkwIt6qYIfPo6sRgwBNYAVOtT 
lo/7O1Z4//HPMdtv0LhvFMoorZ7oOyBhmQIpVp878JdNhmKwZqeA4qS7SlP41CE2Atz5 h+Ow==
X-Received: by 10.112.131.8 with SMTP id oi8mr246378lbb.87.1403428026008; Sun, 
22 Jun 2014 02:07:06 -0700 (PDT)
Received: from ic0.lan.rlan ([212.220.200.211])
by mx.google.com with ESMTPSA id l3sm2261164laf.15.2014.06.22.02.07.04
for misc@openbsd.org (version=TLSv1 cipher=RC4-SHA bits=128/128); 
Sun, 22 Jun 2014 02:07:05 -0700 (PDT)
Content-Type: text/plain; charset=koi8-r; format=flowed; delsp=yes
To: misc@openbsd.org
Date: Sun, 22 Jun 2014 15:06:59 +0600
Subject: Custom kernel with PIPEX without IPSEC failed to compile
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
From: Ivan Solonin iss...@gmail.com
Message-ID: op.xhul9xnc16z...@ic0.lan.rlan
User-Agent: Opera Mail/1.0 (Win32)
List-Help: mailto:majord...@openbsd.org?body=help
List-ID: misc.openbsd.org
List-Owner: mailto:owner-m...@openbsd.org
List-Post: mailto:misc@openbsd.org
List-Subscribe: mailto:majord...@openbsd.org?body=sub%20misc
List-Unsubscribe: mailto:majord...@openbsd.org?body=unsub%20misc
X-Loop: misc@openbsd.org
Precedence: list
Sender: owner-m...@openbsd.org
X-Mailcontrol-Inbound: 8gSgIv9v3sbRnxYICSb3h!uiaIa96vptNsOUTq2TeYo=
X-Spam-Score: -0.354
X-Scanned-By: MailControl 28796.38 (www.mailcontrol.com) on 10.65.0.126
Return-Path: owner-misc+M140770=adam.atkinson=damovo@openbsd.org
X-MS-Exchange-Organization-OriginalArrivalTime: 22 Jun 2014 09:40:08.2531 (UTC)
X-MS-Exchange-Organization-OriginalClientIPAddress: 85.115.52.190
X-MS-Exchange-Organization-OriginalServerIPAddress: 109.204.121.44
X-MS-Exchange-Organization-MessageDirectionality: Incoming
X-MS-Exchange-Organization-Cross-Premises-Headers-Processed: Mail2.damovo.com
X-MS-Exchange-Organization-PRD: openbsd.org
Received-SPF: None (Mail2.damovo.com: owner-m...@openbsd.org does not designate 
permitted sender hosts)
X-MS-Exchange-Organization-OriginalSize: 3097
X-MS-Exchange-Forest-MessageScope: ----
X-MS-Exchange-Organization-MessageScope: ----
X-MS-Exchange-Organization-HygienePolicy: Standard
X-MS-Exchange-Organization-AVStamp-Mailbox: MSFTFF;1;0;0 0 0
X-MS-Exchange-Organization-MessageLatencyInProgress: 
LSRV=Mail2.damovo.com:TOTAL=0;2014-06-22T09:40:08.502Z
X-MS-Exchange-Forest-ArrivalHubServer: UK001B237.d.grp
X-MS-Exchange-Organization-SenderIdResult: NONE
X-MS-Exchange-Organization-AuthSource: Mail2.damovo.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-MessageLatency: SRV=Mail2.damovo.com:TOTAL=0
X-MS-Exchange-Organization-Recipient-Limit-Verified: True
X-MS-Exchange-Forest-RulesExecuted: UK001B237
X-MS-Exchange-Organization-Rules-Execution-History: 
WW-SetDomainsAsNotJunk%%%DamovoUK-FaultEscalation%%%DamovoUK_AutoResponse%%%DE-UPSAlarmRule%%%BE-OutboundDisclaimer%%%WW-OutboundDisclaimer%%%UK-OutboundDisclaimer%%%IE-OutboundDisclaimer%%%DamovoUK_GFiRule%%%DE-Redirect_Techem%%%CH-SupportRule%%%UKScanToEmailBlockExternal

I tried to compile

Re: Custom kernel with PIPEX without IPSEC failed to compile

2014-06-25 Thread Ivan Solonin

Thank you for your reply and patch.

When I found out the mentioned compilation issue, a compiler stopped during 
compilation process with this message:

...
SERS=32 -D_KERNEL -D__landisk__ -MD -MP  -c ../../../../netinet/udp_usrreq.c
../../../../netinet/udp_usrreq.c: In function 'udp_input':
../../../../netinet/udp_usrreq.c:721: error: 'ipsecflowinfo' undeclared (first 
use in this function)
../../../../netinet/udp_usrreq.c:721: error: (Each undeclared identifier is 
reported only once
../../../../netinet/udp_usrreq.c:721: error: for each function it appears in.)
*** Error 1 in target 'udp_usrreq.o'
*** Error 1 in /usr/src/sys/arch/landisk/compile/dms.5.5.conf (Makefile:431 
'udp_usrreq.o')
#

I tried to make changes by myself, but unsuccessfully.

I applied the patch and tried to compile kernel without IPSEC, but still 
unsuccessfully. The compiler claims:

...
SERS=32 -D_KERNEL -D__landisk__ -MD -MP  -c ../../../../netinet/udp_usrreq.c
cc1: warnings being treated as errors
../../../../netinet/udp_usrreq.c: In function 'udp_input':
../../../../netinet/udp_usrreq.c:189: warning: unused variable 'error'
*** Error 1 in target 'udp_usrreq.o'
*** Error 1 in /usr/src/sys/arch/landisk/compile/dms.5.5.conf (Makefile:431 
'udp_usrreq.o')
#

I decided to put #endif /* IPSEC */ by one line below :

# diff -u -p udp_usrreq.c udp_usrreq.c.orig
--- udp_usrreq.cWed Jun 25 21:24:32 2014
+++ udp_usrreq.c.orig   Sat Jan 25 00:54:58 2014
@@ -186,8 +186,8 @@ udp_input(struct mbuf *m, ...)
struct tdb_ident *tdbi;
struct tdb *tdb;
int error;
-#endif /* IPSEC */
u_int32_t ipsecflowinfo = 0;
+#endif /* IPSEC */

va_start(ap, m);
iphlen = va_arg(ap, int);
#

However, kernel compilation still stopped with another message:

cc  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wno-main -Wno-uninitialized 
-Wno-format  -Wstack-larger-than-2047 -m4-nofpu -fno-builtin-printf -fno-builtin-snprintf  
-fno-builtin-vsnprintf -fno-builtin-log  -fno-builtin-log2 -fno-builtin-malloc -fno-pie -O2 -pipe 
-nostdinc -I../../../.. -I. -I../../../../arch -DDDB -DDIAGNOSTIC -DSYSVMSG -DSYSVSEM -DSYSVSHM 
-DFFS -DFFS2 -DFFS_SOFTUPDATES -DUFS_DIRHASH -DMFS -DNFSCLIENT -DNFSSERVER -DMSDOSFS -DFIFO -DTMPFS 
-DSOCKET_SPLICE -DTCP_SACK -DTCP_ECN -DTCP_SIGNATURE -DINET -DALTQ -DINET6 -DPIPEX -DMROUTING 
-DBOOT_CONFIG -DSH4 -DSH7751R -DPCLOCK=0x1fca055 -DDONT_INIT_BSC -DPCIVERBOSE 
-DUSER_PCICONF -DUSBVERBOSE -DSCIFCONSOLE -DSCIFCN_SPEED=0x2580 -DMAXUSERS=32 -D_KERNEL 
-D__landisk__ -MD -MP  -c vers.c
ld -N -Ttext 0x8c002000 -e start --warn-common -nopie -S -x -o dms 
${SYSTEM_HEAD} vers.o ${OBJS}
pipex.o(.text+0x99c): In function `GetNewKeyFromSHA':
: undefined reference to `SHA1Init'
pipex.o(.text+0x9a0): In function `GetNewKeyFromSHA':
: undefined reference to `SHA1Update'
pipex.o(.text+0x9ac): In function `GetNewKeyFromSHA':
: undefined reference to `SHA1Final'
*** Error 1 in /usr/src/sys/arch/landisk/compile/dms.5.5.conf (Makefile:340 
'dms': @echo ld -N -Ttext 0x8c002000 -e start --warn-common -nop...)
#

However, there is the similar hitch with MROUTING option. In case of IPSEC I tried to 
make my own changes in udp_usrreq.c before submitting the letter to misc, but 
I can't do anything with MROUTING.
When I compile with IPSEC and without MROUTING copilation stops with message:

...
S=32 -D_KERNEL -D__landisk__ -MD -MP  -c ../../../../net/pfkeyv2_parsemessage.c
cc1: warnings being treated as errors
In file included from ../../../../net/pfkeyv2_parsemessage.c:79:
../../../../netinet/ip_var.h:178: warning: 'struct socket' declared inside 
parameter list
../../../../netinet/ip_var.h:178: warning: its scope is only this definition or 
declaration, which is probably not what you want
../../../../netinet/ip_var.h:211: warning: 'struct socket' declared inside 
parameter list
../../../../netinet/ip_var.h:216: warning: 'struct socket' declared inside 
parameter list
*** Error 1 in target 'pfkeyv2_parsemessage.o'
*** Error 1 in /usr/src/sys/arch/landisk/compile/dms.5.5.conf (Makefile:446 
'pfkeyv2_parsemessage.o')
#

As I can conclude, multicast routing have dependencies with IPSEC ...

Best wishes,
Ivan

On Mon, 23 Jun 2014 08:37:18 +0600, YASUOKA Masahiko yasu...@yasuoka.net 
wrote:


On Sun, 22 Jun 2014 15:06:59 +0600
Ivan Solonin iss...@gmail.com wrote:

I tried to compile custom kernel in the 5.5 release of OpenBSD on
landisk platform with PIPEX, but found requirment of IPSEC by PIPEX.
As I've found in file /sys/netinet/udp_usrreq.c it uses IPSEC only
with L2TP to distinguish IPsec packets against non-IPsec.
Is PIPEX so strong require IPSEC?


No, it isn't.


Is it possible to compile custom kernel with PIPEX enabled, but
without IPSEC?


Below diff will fix compile without IPSEC.  Also I sent the diff to
tech@ to ask for fixing it in the cvs tree.

Index: sys/netinet/udp_usrreq.c
===
RCS file: /disk/cvs/openbsd/src/sys

Custom kernel with PIPEX without IPSEC failed to compile

2014-06-22 Thread Ivan Solonin

I tried to compile custom kernel in the 5.5 release of OpenBSD on landisk 
platform with PIPEX, but found requirment of IPSEC by PIPEX.
As I've found in file /sys/netinet/udp_usrreq.c it uses IPSEC only with L2TP to 
distinguish IPsec packets against non-IPsec.
Is PIPEX so strong require IPSEC?
Is it possible to compile custom kernel with PIPEX enabled, but without IPSEC?