nos-tun multihomed machines

2001-03-16 Thread Eugene Polovnikov

hi!

Please, review the following PR: 
http://www.freebsd.org/cgi/query-pr.cgi?pr=25847

Same patch is in the attach.

-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCS/CC/IT d-@ s: a- C++ UBSC$ P+@ L- E--- W+ N++ o? K? w-- O- M- V-
PS@ PE@ Y+ PGP+ t 5 X R tv- b+++() DI-- D+(++) G++ e- h--- r y+++
--END GEEK CODE BLOCK--


--- nos-tun.c.orig  Fri Mar 16 11:01:38 2001
+++ nos-tun.c   Fri Mar 16 11:17:35 2001
@@ -239,11 +239,13 @@
   char *point_to = NULL;
   char *to_point = NULL;
   char *target;
+  char *source = NULL;
   char *protocol = NULL;
   int protnum;
 
   struct sockaddr t_laddr;  /* Source address of tunnel */
   struct sockaddr whereto;  /* Destination of tunnel */
+  struct sockaddr wherefrom;/* Source of tunnel */
   struct sockaddr_in *to;
 
   char buf[0x2000]; /* Packets buffer */
@@ -272,7 +274,7 @@
   argc -= optind;
   argv += optind;
 
-  if (argc != 1 || (devname == NULL) ||
+  if ((argc != 1  argc != 2) || (devname == NULL) ||
   (point_to == NULL) || (to_point == NULL)) {
 usage();
   }
@@ -282,7 +284,11 @@
   else
   protnum = atoi(protocol);
 
-  target = *argv;
+  if (argc == 1) {
+  target = *argv;
+  } else {
+  source = *argv++; target = *argv;
+  }
 
   /* Establish logging through 'syslog' */
   openlog("nos-tun", LOG_PID, LOG_DAEMON);
@@ -306,6 +312,15 @@
 Finish(5);
   }
 
+  if (source) { 
+   if (Set_address(source, (struct sockaddr_in *)wherefrom))
+ Finish(9);
+if (bind(net, wherefrom, sizeof(wherefrom))  0) {
+ syslog(LOG_ERR, "can't bind source address - %m");
+ Finish(10);
+   }
+  }
+
   if (connect(net,whereto,sizeof(struct sockaddr_in))  0 ) {
 syslog(LOG_ERR,"can't connect to target - %m");
 close(net);
@@ -365,7 +380,7 @@
 usage()
 {
fprintf(stderr,
-"usage: nos-tun -t tun_name -s source_addr -d dest_addr -p protocol_number 
target_addr\n");
+"usage: nos-tun -t tun_name -s source_addr -d dest_addr -p protocol_number 
+[source_addr] target_addr\n");
exit(1);
 }
 



Re: HEADS UP: I386_CPU

2001-01-18 Thread Eugene Polovnikov

how about to have in a distribution two version of GENERIC kernel 
(and modules of course) and let sysinstall choose right set ?


In article [EMAIL PROTECTED] you wrote:

 On Tuesday, 16 January 2001 at  9:28:43 -0500, Will Andrews wrote:
 On Tue, Jan 16, 2001 at 09:16:14AM -0500, Kenneth Wayne Culver wrote:
 Wont this make installing using sysinstall a bit hard? I know the generic
 kernel includes all the CPU lines, so that all cpu's are recognized... so
 are you going to just take this line out of the generic kernel, and have a
 special kern.flp disk with a generic kernel that only has the i386 support
 in it?

 I don't think it's worth the effort.  By the time 5.0-RELEASE goes out,
 the 386 will have been around for over 10 years (actually I think it has
 already reached that point and gone beyond).  There are not likely to be
 many more installs of FreeBSD on 386's, let alone 5.x installs.

 People who *really* want to install 5.x on a 386 can generate their own
 kernel and such.

 Don't forget that the i386 is still a popular CPU for embedded work.
 Of course, embedded people will have less of an issue with sysinstall.

 Greg
 --
 Finger [EMAIL PROTECTED] for PGP public key
 See complete headers for address and phone numbers


 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-current" in the body of the message


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
-- end of forwarded message --


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message