Changeset 2a6ca4f
- Timestamp:
- 2006-01-04T11:16:58Z (19 years ago)
- Branches:
- master
- Children:
- 0196c47
- Parents:
- 13c4cd3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
r13c4cd3 r2a6ca4f 89 89 listen_addr.sin6_family = AF_INETx; 90 90 listen_addr.sin6_port = htons( global.conf->port ); 91 i = inet_pton( AF_INETx, global.conf->iface, &listen_addr.sin6_addr );91 i = inet_pton( AF_INETx, ipv6_wrap( global.conf->iface ), &listen_addr.sin6_addr ); 92 92 #else 93 93 listen_addr.sin_family = AF_INETx; -
bitlbee.conf
r13c4cd3 r2a6ca4f 22 22 ## DaemonPort/DaemonInterface: 23 23 ## 24 ## For RunMode=Daemon, here you can specify on what interface and port the25 ## daemonshould be listening for connections.24 ## For daemon mode, you can specify on what interface and port the daemon 25 ## should be listening for connections. 26 26 ## 27 27 # DaemonInterface = 0.0.0.0 … … 55 55 ## Normally, BitlBee gets a hostname using getsockname(). If you have a nicer 56 56 ## alias for your BitlBee daemon, you can set it here and BitlBee will identify 57 ## itself with that name instead. Leave it commented out if you want BitlBee to 58 ## use getsockname() to get a hostname. 57 ## itself with that name instead. 59 58 ## 60 59 # HostName = localhost -
conf.c
r13c4cd3 r2a6ca4f 46 46 conf = g_new0( conf_t, 1 ); 47 47 48 #ifdef IPV6 49 conf->iface = "::"; 50 #else 48 51 conf->iface = "0.0.0.0"; 52 #endif 49 53 conf->port = 6667; 50 54 conf->nofork = 0; -
irc.c
r13c4cd3 r2a6ca4f 83 83 irc->myhost = g_strdup( peer->h_name ); 84 84 else if( inet_ntop( AF_INETx, &sock->sin6_addr, buf, sizeof( buf ) - 1 ) != NULL ) 85 irc->myhost = g_strdup( buf);85 irc->myhost = g_strdup( ipv6_unwrap( buf ) ); 86 86 } 87 87 #else … … 102 102 irc->host = g_strdup( peer->h_name ); 103 103 else if( inet_ntop( AF_INETx, &sock->sin6_addr, buf, sizeof( buf ) - 1 ) != NULL ) 104 irc->host = g_strdup( buf);104 irc->host = g_strdup( ipv6_unwrap( buf ) ); 105 105 } 106 106 #else … … 114 114 #endif 115 115 116 /* Rare, but possible. */ 116 117 if( !irc->host ) irc->host = g_strdup( "localhost." ); 117 118 if( !irc->myhost ) irc->myhost = g_strdup( "localhost." ); -
protocols/nogaim.h
r13c4cd3 r2a6ca4f 288 288 G_MODULE_EXPORT void serv_got_chat_in( struct gaim_connection *gc, int id, char *who, int whisper, char *msg, time_t mtime ); 289 289 G_MODULE_EXPORT void serv_got_chat_left( struct gaim_connection *gc, int id ); 290 /* void serv_finish_login( struct gaim_connection *gc ); */291 290 292 291 /* util.c */ … … 299 298 G_MODULE_EXPORT char *escape_html( const char *html ); 300 299 G_MODULE_EXPORT void info_string_append(GString *str, char *newline, char *name, char *value); 300 G_MODULE_EXPORT char *ipv6_wrap( char *src ); 301 G_MODULE_EXPORT char *ipv6_unwrap( char *src ); 301 302 302 303 /* prefs.c */ -
util.c
r13c4cd3 r2a6ca4f 403 403 return source; 404 404 } 405 406 #ifdef IPV6 407 /* Wrap an IPv4 address into IPv6 space. Not thread-safe... */ 408 char *ipv6_wrap( char *src ) 409 { 410 static char dst[64]; 411 int i; 412 413 for( i = 0; src[i]; i ++ ) 414 if( ( src[i] < '0' || src[i] > '9' ) && src[i] != '.' ) 415 break; 416 417 /* Hmm, it's not even an IP... */ 418 if( src[i] ) 419 return src; 420 421 g_snprintf( dst, sizeof( dst ), "::ffff:%s", src ); 422 423 return dst; 424 } 425 426 /* Unwrap an IPv4 address into IPv6 space. Thread-safe, because it's very simple. :-) */ 427 char *ipv6_unwrap( char *src ) 428 { 429 int i; 430 431 if( g_strncasecmp( src, "::ffff:", 7 ) != 0 ) 432 return src; 433 434 for( i = 7; src[i]; i ++ ) 435 if( ( src[i] < '0' || src[i] > '9' ) && src[i] != '.' ) 436 break; 437 438 /* Hmm, it's not even an IP... */ 439 if( src[i] ) 440 return src; 441 442 return ( src + 7 ); 443 } 444 #endif
Note: See TracChangeset
for help on using the changeset viewer.