mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 04:33:57 +00:00
f584c9fe75
svn path=/nixpkgs/trunk/; revision=8964
39 lines
1.0 KiB
Diff
39 lines
1.0 KiB
Diff
diff -urN ncat-0.10rc3/ncat_main.c ncat-0.10rc3-fixed/ncat_main.c
|
|
--- ncat-0.10rc3/ncat_main.c 2006-01-10 03:29:08.000000000 +0300
|
|
+++ ncat-0.10rc3-fixed/ncat_main.c 2007-07-09 09:58:58.000000000 +0400
|
|
@@ -23,6 +23,7 @@
|
|
{
|
|
struct sockaddr_in ss;
|
|
struct sockaddr_in6 ss6;
|
|
+ struct sockaddr_storage sst;
|
|
|
|
struct conn_state cs;
|
|
|
|
@@ -271,7 +272,7 @@
|
|
}
|
|
|
|
/* resolve hostname */
|
|
- if (!resolve(argv[optind], (struct sockaddr_storage *) &ss)) {
|
|
+ if (!resolve(argv[optind], (struct sockaddr_storage *) &sst)) {
|
|
/* host failed to resolve :( */
|
|
fprintf(stderr,
|
|
"%s: Could not resolve target hostname %s. QUITTING.\n",
|
|
@@ -297,6 +298,8 @@
|
|
|
|
/* IPv6 connect() */
|
|
if (oipv == 6) {
|
|
+ memcpy(&ss6,&sst,sizeof(ss6));
|
|
+
|
|
ss6.sin6_family = AF_INET6;
|
|
ss_len = sizeof(struct sockaddr_in6);
|
|
|
|
@@ -329,6 +332,8 @@
|
|
}
|
|
/* IPv4 connect() - default. */
|
|
else {
|
|
+ memcpy(&ss,&sst,sizeof(ss));
|
|
+
|
|
ss.sin_family = AF_INET;
|
|
ss_len = sizeof(struct sockaddr_in);
|
|
|