[Openswan dev] [PATCH] Fix NETLINK update_nat_t segfault

Herbert Xu herbert at gondor.apana.org.au
Tue Apr 13 17:47:27 CEST 2004


Hi:

This patch fixes a segfault in netlink's add_sa function when it is
called by update_nat_t.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-------------- next part --------------
Index: programs/pluto/kernel_netlink.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/openswan/programs/pluto/kernel_netlink.c,v
retrieving revision 1.2
diff -u -r1.2 kernel_netlink.c
--- a/programs/pluto/kernel_netlink.c	15 Mar 2004 11:01:57 -0000	1.2
+++ b/programs/pluto/kernel_netlink.c	13 Apr 2004 06:45:05 -0000
@@ -539,12 +539,12 @@
 	ip2xfrm(&sa->dst_client->addr, &req.p.sel.daddr);
 	req.p.sel.prefixlen_s = sa->src_client->maskbits;
 	req.p.sel.prefixlen_d = sa->dst_client->maskbits;
+	req.p.sel.family = sa->src_client->addr.u.v4.sin_family;
     }
 
     req.p.id.spi = sa->spi;
     req.p.id.proto = satype2proto(sa->satype);
     req.p.family = sa->src->u.v4.sin_family;
-    req.p.sel.family = sa->src_client->addr.u.v4.sin_family;
     req.p.mode = (sa->encapsulation == ENCAPSULATION_MODE_TUNNEL);
     req.p.replay_window = sa->replay_window;
     req.p.reqid = sa->reqid;


More information about the Dev mailing list