Module Name: src Committed By: knakahara Date: Tue Mar 10 10:35:14 UTC 2020
Modified Files: src/sys/net: if_ipsec.c Log Message: Fix ipsecif(4) SPDADD pfkey message has garbage. Pointed out by ohishi@IIJ. "setkey -x" output is the following. ========== before ========== sadb_msg{ version=2 type=14 errno=0 satype=0 len=15 reserved=0 seq=0 pid=0 sadb_ext{ len=56 type=18 } sadb_x_policy{ type=2 dir=1 id=9 } { len=40 proto=50 mode=1 level=3 reqid=16393 sockaddr{ len=0 family=0 } sockaddr{ len=0 family=0 } } ========== before ========== ========== after ========== sadb_msg{ version=2 type=14 errno=0 satype=0 len=11 reserved=0 seq=0 pid=0 sadb_ext{ len=24 type=18 } sadb_x_policy{ type=2 dir=1 id=9 } { len=8 proto=50 mode=1 level=3 reqid=16393 } ========== after ========== To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/net/if_ipsec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_ipsec.c diff -u src/sys/net/if_ipsec.c:1.27 src/sys/net/if_ipsec.c:1.28 --- src/sys/net/if_ipsec.c:1.27 Sat Feb 1 02:57:55 2020 +++ src/sys/net/if_ipsec.c Tue Mar 10 10:35:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ipsec.c,v 1.27 2020/02/01 02:57:55 riastradh Exp $ */ +/* $NetBSD: if_ipsec.c,v 1.28 2020/03/10 10:35:14 knakahara Exp $ */ /* * Copyright (c) 2017 Internet Initiative Japan Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.27 2020/02/01 02:57:55 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.28 2020/03/10 10:35:14 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1679,7 +1679,7 @@ if_ipsec_add_sp0(struct sockaddr *src, i ext_msg_len += PFKEY_UNIT64(size); size = if_ipsec_set_sadb_dst(&xdst, dst, proto); ext_msg_len += PFKEY_UNIT64(size); - size = if_ipsec_set_sadb_x_policy(&xpl, &xisr, policy, dir, 0, level, src, dst); + size = if_ipsec_set_sadb_x_policy(&xpl, &xisr, policy, dir, 0, level, NULL, NULL); ext_msg_len += PFKEY_UNIT64(size); if_ipsec_set_sadb_msg_add(&msg, ext_msg_len);