Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/ipsec-tools-0_8-branch]: src/crypto/dist/ipsec-tools/src/racoon Fix sour...
details: https://anonhg.NetBSD.org/src/rev/5843c951f9cd
branches: ipsec-tools-0_8-branch
changeset: 763340:5843c951f9cd
user: tteras <tteras%NetBSD.org@localhost>
date: Tue Feb 05 11:36:41 2013 +0000
description:
Fix source port selection
diffstat:
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r f60d15c0985f -r 5843c951f9cd crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
--- a/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c Tue Feb 05 06:23:42 2013 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c Tue Feb 05 11:36:41 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: grabmyaddr.c,v 1.28 2011/03/14 17:18:12 tteras Exp $ */
+/* $NetBSD: grabmyaddr.c,v 1.28.2.1 2013/02/05 11:36:41 tteras Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* Copyright (C) 2008 Timo Teras <timo.teras%iki.fi@localhost>.
@@ -274,13 +274,24 @@
struct sockaddr *addr;
{
struct myaddr *my;
+ int port = 0, wport;
LIST_FOREACH(my, &opened, chain) {
- if (cmpsaddr((struct sockaddr *) &my->addr, addr) <= CMPSADDR_WILDPORT_MATCH)
+ switch (cmpsaddr((struct sockaddr *) &my->addr, addr)) {
+ case CMPSADDR_MATCH:
return extract_port((struct sockaddr *) &my->addr);
+ case CMPSADDR_WILDPORT_MATCH:
+ wport = extract_port((struct sockaddr *) &my->addr);
+ if (port == 0 || wport < port)
+ port = wport;
+ break;
+ }
}
+
+ if (port == 0)
+ port = PORT_ISAKMP;
- return PORT_ISAKMP;
+ return port;
}
void
Home |
Main Index |
Thread Index |
Old Index