diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-02-05 13:41:25 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-02-05 13:41:55 +0200 |
commit | ba39f71b2a8dfd155684df4b01f098039b68389e (patch) | |
tree | 3f88043924f0726a1ff7861e2458a26011fdb101 /main/ipsec-tools/03-fix-sport-selection.patch | |
parent | 4382b60ad0a9738a21beb561c1e39cdd43b9c9f3 (diff) | |
download | aports-ba39f71b2a8dfd155684df4b01f098039b68389e.tar.bz2 aports-ba39f71b2a8dfd155684df4b01f098039b68389e.tar.xz |
main/ipsec-tools: cherry-pick fixes from upstream
Diffstat (limited to 'main/ipsec-tools/03-fix-sport-selection.patch')
-rw-r--r-- | main/ipsec-tools/03-fix-sport-selection.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/main/ipsec-tools/03-fix-sport-selection.patch b/main/ipsec-tools/03-fix-sport-selection.patch new file mode 100644 index 0000000000..56cd999b39 --- /dev/null +++ b/main/ipsec-tools/03-fix-sport-selection.patch @@ -0,0 +1,29 @@ +--- a/src/racoon/grabmyaddr.c 14 Mar 2011 17:18:12 -0000 1.28 ++++ b/src/racoon/grabmyaddr.c 5 Feb 2013 11:32:59 -0000 +@@ -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 |