FreeBSD Bugzilla – Attachment 13636 Details for
Bug 25847
inability of nos-tun to work correctly in multihomed environment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.68 KB, created by
eugene
on 2001-03-16 09:20:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
eugene
Created:
2001-03-16 09:20:00 UTC
Size:
1.68 KB
patch
obsolete
>--- 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); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25847
: 13636