summaryrefslogtreecommitdiff
path: root/chat/i2cb/patches
diff options
context:
space:
mode:
authorhubertf <hubertf>2004-04-13 21:19:48 +0000
committerhubertf <hubertf>2004-04-13 21:19:48 +0000
commitf89323b054346145890d80e1efc5981e1b80133a (patch)
tree1266bcb7bdad4cb4b50a71c9c053eb772f1e5256 /chat/i2cb/patches
parentb957655b7ba353b72fdc916c55c477c6fa97b881 (diff)
downloadpkgsrc-f89323b054346145890d80e1efc5981e1b80133a.tar.gz
Add a -lhost switch to allow binding to a local address on a multihomed
host (i.e. choose with which address to connect to the server). Bump revision to i2cb-6.0_ALPHAnb1.
Diffstat (limited to 'chat/i2cb/patches')
-rw-r--r--chat/i2cb/patches/patch-ac19
-rw-r--r--chat/i2cb/patches/patch-af60
-rw-r--r--chat/i2cb/patches/patch-aq12
-rw-r--r--chat/i2cb/patches/patch-ar13
-rw-r--r--chat/i2cb/patches/patch-as73
5 files changed, 173 insertions, 4 deletions
diff --git a/chat/i2cb/patches/patch-ac b/chat/i2cb/patches/patch-ac
index 07041ab7bb4..aecca1dccb8 100644
--- a/chat/i2cb/patches/patch-ac
+++ b/chat/i2cb/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.1.1.1 2002/11/14 00:55:44 hubertf Exp $
+$NetBSD: patch-ac,v 1.2 2004/04/13 21:19:48 hubertf Exp $
--- src/externs.h.orig Wed Mar 15 23:28:13 2000
+++ src/externs.h
@@ -13,3 +13,20 @@ $NetBSD: patch-ac,v 1.1.1.1 2002/11/14 00:55:44 hubertf Exp $
/* external definitions for "icb" global variables */
/* defined in port.c */
+@@ -25,6 +29,7 @@ extern char *mygroup; /* requested grou
+ extern char *myserver; /* server name */
+ extern char *myhost; /* server host */
+ extern int myport; /* server port */
++extern char *mylhost; /* local address */
+ extern char *mbuf; /* message buffer */
+ extern char *mbuf2; /* message buffer */
+ extern int connected; /* whether we are validated or not */
+@@ -69,7 +74,7 @@ void clearargs (int argc, char **argv);
+ int clientserve (void);
+ void closesessionlog (void);
+ void cmdoutmsg (char *pkt);
+-int connecttoport (char *host_name, int port_number);
++int connecttoport (char *host_name, int port_number, char *lhost_name);
+ void copenmsg (char *pkt);
+ void cpersonalmsg (char *pkt);
+ void csendopen (char *txt);
diff --git a/chat/i2cb/patches/patch-af b/chat/i2cb/patches/patch-af
index ad5597b0e15..548ce3ad17d 100644
--- a/chat/i2cb/patches/patch-af
+++ b/chat/i2cb/patches/patch-af
@@ -1,13 +1,67 @@
-$NetBSD: patch-af,v 1.1.1.1 2002/11/14 00:55:44 hubertf Exp $
+$NetBSD: patch-af,v 1.2 2004/04/13 21:19:48 hubertf Exp $
---- src/contoport.c.orig Wed Mar 15 23:13:28 2000
+--- src/contoport.c.orig Tue Apr 13 22:29:28 2004
+++ src/contoport.c
-@@ -21,7 +21,7 @@
+@@ -14,14 +14,15 @@
+ #include "icb.h"
+ #include "externs.h"
+
+-int connecttoport (char *host_name, int port_number);
++int connecttoport (char *host_name, int port_number, char *lhost_name);
+
+ int
+-connecttoport (char *host_name, int port_number)
++connecttoport (char *host_name, int port_number, char *lhost_name)
{
struct addrinfo hints, *res, *a;
++ struct addrinfo lhints, *lres, *la;
char p[10];
- int err, s;
+ int err, s=-1;
snprintf(p, 9, "%d", port_number);
+@@ -36,12 +37,43 @@ connecttoport (char *host_name, int port
+ perror(gai_strerror(err));
+ return(-1);
+ }
++
++ if (lhost_name != NULL) {
++ memset(&lhints, 0, sizeof(lhints));
++ lhints.ai_socktype = SOCK_STREAM;
++ lhints.ai_family = PF_UNSPEC;
++ lhints.ai_flags = AI_PASSIVE;
++
++ err = getaddrinfo(lhost_name, p, &lhints, &lres);
++ if (err) {
++ perror(gai_strerror(err));
++ return(-1);
++ }
++ }
++
+ a = res;
+ while (a) {
+ if ((s = socket(a->ai_family, a->ai_socktype, a->ai_protocol)) < 0) {
+ a = a->ai_next;
+ continue;
+ }
++
++ if (lhost_name != NULL) {
++ err = -1;
++ for(la = lres; la; la=la->ai_next) {
++ if (bind(s, la->ai_addr, la->ai_addrlen) == 0) {
++ /* bound locally! */
++ err = 0;
++ break;
++ }
++ }
++ freeaddrinfo(lres);
++ if (err < 0) {
++ perror(gai_strerror(err));
++ return(-1);
++ }
++ }
++
+ if (connect(s, a->ai_addr, a->ai_addrlen) < 0) {
+ close(s);
+ a = a->ai_next;
diff --git a/chat/i2cb/patches/patch-aq b/chat/i2cb/patches/patch-aq
new file mode 100644
index 00000000000..437e726adc9
--- /dev/null
+++ b/chat/i2cb/patches/patch-aq
@@ -0,0 +1,12 @@
+$NetBSD: patch-aq,v 1.1 2004/04/13 21:19:48 hubertf Exp $
+
+--- src/globals.c.orig Wed Mar 15 23:13:28 2000
++++ src/globals.c
+@@ -26,6 +26,7 @@ char *mygroup = ""; /* requested group
+ char *myserver = NULL; /* name of server */
+ char *myhost = NULL; /* hostname of server */
+ int myport = 0; /* string form of port number */
++char *mylhost = NULL; /* local address */
+ int connected = 0; /* 1 when server validates us */
+ char continued = 0; /* did we bg then fg this job? */
+ int whoflg = 0; /* just do a who at startup */
diff --git a/chat/i2cb/patches/patch-ar b/chat/i2cb/patches/patch-ar
new file mode 100644
index 00000000000..8eabcf648c0
--- /dev/null
+++ b/chat/i2cb/patches/patch-ar
@@ -0,0 +1,13 @@
+$NetBSD: patch-ar,v 1.1 2004/04/13 21:19:48 hubertf Exp $
+
+--- src/helpdata.c.orig Wed Mar 15 23:42:52 2000
++++ src/helpdata.c
+@@ -344,6 +344,8 @@ char *ht_options[] =
+ "",
+ " -port port try to connect to port port.",
+ "",
++" -lhost lhost connect from local address lhost.",
++"",
+ " -list list known servers, in order.",
+ "",
+ " -clear wipe args from command line.",
diff --git a/chat/i2cb/patches/patch-as b/chat/i2cb/patches/patch-as
new file mode 100644
index 00000000000..cef57c0d68f
--- /dev/null
+++ b/chat/i2cb/patches/patch-as
@@ -0,0 +1,73 @@
+$NetBSD: patch-as,v 1.1 2004/04/13 21:19:48 hubertf Exp $
+
+--- src/main.c.orig Wed Mar 15 23:13:28 2000
++++ src/main.c
+@@ -19,6 +19,7 @@ static void usage (char *name, int ret);
+
+ char *optv[] = { "clear", "list", "who", "restricted", "nickname:", "group:",
+ "host:", "port:", "password:", "server:", "N:", "help/",
++ "lhost:",
+ (char *)NULL };
+
+ static void
+@@ -33,6 +34,7 @@ fprintf(stderr," -group group\t\tsign o
+ fprintf(stderr," -server name\t\tconnect to server named name.\n");
+ fprintf(stderr," -host host\t\tconnect to server on host host.\n");
+ fprintf(stderr," -port port\t\ttry to connect to port port.\n");
++fprintf(stderr," -lhost lhost\t\tconnect from local address lhost.\n");
+ fprintf(stderr," -list\t\t\tlist known servers, in order.\n");
+ fprintf(stderr," -clear\t\twipe args from command line.\n");
+ fprintf(stderr," -who\t\t\tsee who's on; don't sign on.\n");
+@@ -56,12 +58,14 @@ main (int argc, char **argv)
+ static char server[MAX_NICKLEN+1];
+ static char host[MAX_HOSTLEN+1];
+ static char pass[MAX_PASSLEN+1];
++ static char lhost[MAX_HOSTLEN+1];
+
+ mynick = NULL;
+ mygroup = "1";
+ myserver = NULL;
+ myhost = NULL;
+ myport = DEFAULTPORT;
++ mylhost = NULL;
+
+ switcherr=0;
+ while ((s = getswitch(argc, argv, optv)) != NULL)
+@@ -93,8 +97,18 @@ main (int argc, char **argv)
+ break;
+
+ case 'l':
+- listflg++;
+- gv.interactive = 0;
++ switch (s[1])
++ {
++ case 'i':
++ listflg++;
++ gv.interactive = 0;
++ break;
++ case 'h':
++ strncpy(lhost,switcharg,MAX_HOSTLEN-1);
++ lhost[MAX_HOSTLEN-1]='\0';
++ mylhost = lhost;
++ break;
++ }
+ break;
+
+ case 'p':
+@@ -261,14 +275,14 @@ main (int argc, char **argv)
+ myport = serverdata->port;
+ }
+
+- if (connecttoport(myhost, myport) < 0)
++ if (connecttoport(myhost, myport, mylhost) < 0)
+ {
+ connected = 0;
+ if (try)
+ {
+ while ((serverdata = getserver())!=NULL)
+ {
+- if (connecttoport(serverdata->host, serverdata->port) == 0)
++ if (connecttoport(serverdata->host, serverdata->port, mylhost) == 0)
+ {
+ connected = 1;
+ break;