From f88b7a076be74a29a3bf876b4e2705f4a1ecf42b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Oct 2007 14:16:54 -0700 Subject: This is a large patch (sorry). Migrate from struct in_addr to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd) --- source3/include/ads.h | 2 +- source3/include/client.h | 2 +- source3/include/includes.h | 2 +- source3/include/smb.h | 4 ++-- source3/include/smb_macros.h | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index 37d09f1e42..a75eaf80fc 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -87,7 +87,7 @@ typedef struct ads_struct { #ifdef HAVE_LDAP struct { LDAP *ld; - struct in_addr ip; /* the ip of the active connection, if any */ + struct sockaddr_storage ss; /* the ip of the active connection, if any */ time_t last_attempt; /* last attempt to reconnect */ int port; diff --git a/source3/include/client.h b/source3/include/client.h index 597348d162..c4669dbf2e 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -112,7 +112,7 @@ struct cli_state { struct nmb_name called; struct nmb_name calling; fstring full_dest_host_name; - struct in_addr dest_ip; + struct sockaddr_storage dest_ss; DATA_BLOB secblob; /* cryptkey or negTokenInit */ uint32 sesskey; diff --git a/source3/include/includes.h b/source3/include/includes.h index 0d51c3d049..fc9e43e55b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1123,7 +1123,7 @@ void krb5_free_unparsed_name(krb5_context ctx, char *val); #endif /* Samba wrapper function for krb5 functionality. */ -void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr); +void setup_kaddr_v4( krb5_address *pkaddr, struct sockaddr *paddr); int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype); int create_kerberos_key_from_string_direct(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype); bool get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, krb5_ticket *tkt); diff --git a/source3/include/smb.h b/source3/include/smb.h index 6d4effda5e..4c51acf6f4 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -629,7 +629,7 @@ typedef struct connection_struct { char *user; /* name of user who *opened* this connection */ uid_t uid; /* uid of user who *opened* this connection */ gid_t gid; /* gid of user who *opened* this connection */ - char client_address[18]; /* String version of client IP address. */ + char client_address[INET6_ADDRSTRLEN]; /* String version of client IP address. */ uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ @@ -1850,7 +1850,7 @@ typedef struct _smb_iconv_t { /* used by the IP comparison function */ struct ip_service { - struct in_addr ip; + struct sockaddr_storage ss; unsigned port; }; diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index aea429d2ea..9af63451b0 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -206,11 +206,10 @@ values ((int)(tvalnew)->tv_usec - (int)(tvalold)->tv_usec)/1000) /**************************************************************************** -true if two IP addresses are equal +true if two IPv4 addresses are equal ****************************************************************************/ -#define ip_equal(ip1,ip2) ((ip1).s_addr == (ip2).s_addr) -#define ip_service_equal(ip1,ip2) ( ((ip1).ip.s_addr == (ip2).ip.s_addr) && ((ip1).port == (ip2).port) ) +#define ip_equal_v4(ip1,ip2) ((ip1).s_addr == (ip2).s_addr) /***************************************************************** splits out the last subkey of a key -- cgit