summaryrefslogtreecommitdiffstats
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-02 03:58:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:15 -0500
commit5011f901aa0140ed60a0b58e80ab0f14810ba432 (patch)
tree379ad85e8627394a47bbac5e783e0955a5a5d481 /source4/lib
parent2f7d7e47e38d88655baddad4e2e0572d4c158f70 (diff)
downloadsamba-5011f901aa0140ed60a0b58e80ab0f14810ba432.tar.gz
samba-5011f901aa0140ed60a0b58e80ab0f14810ba432.tar.xz
samba-5011f901aa0140ed60a0b58e80ab0f14810ba432.zip
r3457: s_addr is a macro on solaris, so we can't use it in structure names. arrgh.
(This used to be commit 7842b23d01c53009259a2461600bd01159cecebf)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/netif/interface.c30
-rw-r--r--source4/lib/socket/socket_ipv4.c8
-rw-r--r--source4/lib/system.c4
-rw-r--r--source4/lib/util.c8
-rw-r--r--source4/lib/util_sock.c4
-rw-r--r--source4/lib/util_strlist.c2
6 files changed, 28 insertions, 28 deletions
diff --git a/source4/lib/netif/interface.c b/source4/lib/netif/interface.c
index 75fdf8c9762..1db0f5caee5 100644
--- a/source4/lib/netif/interface.c
+++ b/source4/lib/netif/interface.c
@@ -45,7 +45,7 @@ static struct interface *local_interfaces;
static struct ipv4_addr tov4(struct in_addr in)
{
struct ipv4_addr in2;
- in2.s_addr = in.s_addr;
+ in2.addr = in.s_addr;
return in2;
}
@@ -60,7 +60,7 @@ static struct interface *iface_find(struct in_addr ip, BOOL CheckMask)
for (i=local_interfaces;i;i=i->next)
if (CheckMask) {
if (same_net(i->ip,tov4(ip),i->nmask)) return i;
- } else if ((i->ip).s_addr == ip.s_addr) return i;
+ } else if (i->ip.addr == ip.s_addr) return i;
return NULL;
}
@@ -77,7 +77,7 @@ static void add_interface(struct in_addr ip, struct in_addr nmask)
return;
}
- if (ip_equal(nmask, allones_ip)) {
+ if (nmask.s_addr == allones_ip.addr) {
DEBUG(3,("not adding non-broadcast interface %s\n",inet_ntoa(ip)));
return;
}
@@ -89,7 +89,7 @@ static void add_interface(struct in_addr ip, struct in_addr nmask)
iface->ip = tov4(ip);
iface->nmask = tov4(nmask);
- iface->bcast.s_addr = MKBCADDR(iface->ip.s_addr, iface->nmask.s_addr);
+ iface->bcast.addr = MKBCADDR(iface->ip.addr, iface->nmask.addr);
DLIST_ADD(local_interfaces, iface);
@@ -133,10 +133,10 @@ static void interpret_interface(TALLOC_CTX *mem_ctx, const char *token)
/* maybe it is a DNS name */
p = strchr_m(token,'/');
if (!p) {
- ip.s_addr = interpret_addr2(token).s_addr;
+ ip.s_addr = interpret_addr2(token).addr;
for (i=0;i<total_probed;i++) {
if (ip.s_addr == probed_ifaces[i].ip.s_addr &&
- !ip_equal(allones_ip, probed_ifaces[i].netmask)) {
+ allones_ip.addr != probed_ifaces[i].netmask.s_addr) {
add_interface(probed_ifaces[i].ip,
probed_ifaces[i].netmask);
return;
@@ -149,10 +149,10 @@ static void interpret_interface(TALLOC_CTX *mem_ctx, const char *token)
/* parse it into an IP address/netmasklength pair */
*p++ = 0;
- ip.s_addr = interpret_addr2(token).s_addr;
+ ip.s_addr = interpret_addr2(token).addr;
if (strlen(p) > 2) {
- nmask.s_addr = interpret_addr2(p).s_addr;
+ nmask.s_addr = interpret_addr2(p).addr;
} else {
nmask.s_addr = htonl(((ALLONES >> atoi(p)) ^ ALLONES));
}
@@ -219,8 +219,8 @@ void load_interfaces(void)
exit(1);
}
for (i=0;i<total_probed;i++) {
- if (probed_ifaces[i].netmask.s_addr != allones_ip.s_addr &&
- probed_ifaces[i].ip.s_addr != loopback_ip.s_addr) {
+ if (probed_ifaces[i].netmask.s_addr != allones_ip.addr &&
+ probed_ifaces[i].ip.s_addr != loopback_ip.addr) {
add_interface(probed_ifaces[i].ip,
probed_ifaces[i].netmask);
}
@@ -270,7 +270,7 @@ BOOL ismyip(struct ipv4_addr ip)
{
struct interface *i;
for (i=local_interfaces;i;i=i->next)
- if (ip_equal(i->ip,ip)) return True;
+ if (ipv4_equal(i->ip,ip)) return True;
return False;
}
@@ -281,8 +281,8 @@ BOOL is_local_net(struct ipv4_addr from)
{
struct interface *i;
for (i=local_interfaces;i;i=i->next) {
- if((from.s_addr & i->nmask.s_addr) ==
- (i->ip.s_addr & i->nmask.s_addr))
+ if((from.addr & i->nmask.addr) ==
+ (i->ip.addr & i->nmask.addr))
return True;
}
return False;
@@ -339,7 +339,7 @@ struct ipv4_addr *iface_ip(struct ipv4_addr ip)
{
struct in_addr in;
struct interface *i;
- in.s_addr = ip.s_addr;
+ in.s_addr = ip.addr;
i = iface_find(in, True);
return(i ? &i->ip : &local_interfaces->ip);
}
@@ -350,6 +350,6 @@ struct ipv4_addr *iface_ip(struct ipv4_addr ip)
BOOL iface_local(struct ipv4_addr ip)
{
struct in_addr in;
- in.s_addr = ip.s_addr;
+ in.s_addr = ip.addr;
return iface_find(in, True) ? True : False;
}
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c
index 263f5aa2550..eebbd61219b 100644
--- a/source4/lib/socket/socket_ipv4.c
+++ b/source4/lib/socket/socket_ipv4.c
@@ -48,13 +48,13 @@ static NTSTATUS ipv4_tcp_connect(struct socket_context *sock,
my_ip = interpret_addr2(my_address);
- if (my_ip.s_addr != 0 || my_port != 0) {
+ if (my_ip.addr != 0 || my_port != 0) {
struct sockaddr_in my_addr;
ZERO_STRUCT(my_addr);
#ifdef HAVE_SOCK_SIN_LEN
my_addr.sin_len = sizeof(my_addr);
#endif
- my_addr.sin_addr.s_addr = my_ip.s_addr;
+ my_addr.sin_addr.s_addr = my_ip.addr;
my_addr.sin_port = htons(my_port);
my_addr.sin_family = PF_INET;
@@ -70,7 +70,7 @@ static NTSTATUS ipv4_tcp_connect(struct socket_context *sock,
#ifdef HAVE_SOCK_SIN_LEN
srv_addr.sin_len = sizeof(srv_addr);
#endif
- srv_addr.sin_addr.s_addr= srv_ip.s_addr;
+ srv_addr.sin_addr.s_addr= srv_ip.addr;
srv_addr.sin_port = htons(srv_port);
srv_addr.sin_family = PF_INET;
@@ -105,7 +105,7 @@ static NTSTATUS ipv4_tcp_listen(struct socket_context *sock,
#ifdef HAVE_SOCK_SIN_LEN
my_addr.sin_len = sizeof(my_addr);
#endif
- my_addr.sin_addr.s_addr = ip_addr.s_addr;
+ my_addr.sin_addr.s_addr = ip_addr.addr;
my_addr.sin_port = htons(port);
my_addr.sin_family = PF_INET;
diff --git a/source4/lib/system.c b/source4/lib/system.c
index 5e106c96eb5..d50005e8c8b 100644
--- a/source4/lib/system.c
+++ b/source4/lib/system.c
@@ -540,7 +540,7 @@ int sys_dup2(int oldfd, int newfd)
const char *sys_inet_ntoa(struct ipv4_addr in)
{
struct in_addr in2;
- in2.s_addr = in.s_addr;
+ in2.s_addr = in.addr;
return inet_ntoa(in2);
}
@@ -554,7 +554,7 @@ struct ipv4_addr sys_inet_makeaddr(int net, int host)
struct in_addr in;
struct ipv4_addr in2;
in = inet_makeaddr(net, host);
- in2.s_addr = in.s_addr;
+ in2.addr = in.s_addr;
return in2;
}
diff --git a/source4/lib/util.c b/source4/lib/util.c
index 2ce34f58d99..5385174ce45 100644
--- a/source4/lib/util.c
+++ b/source4/lib/util.c
@@ -452,7 +452,7 @@ struct ipv4_addr interpret_addr2(const char *str)
{
struct ipv4_addr ret;
uint32_t a = interpret_addr(str);
- ret.s_addr = a;
+ ret.addr = a;
return ret;
}
@@ -486,9 +486,9 @@ BOOL same_net(struct ipv4_addr ip1,struct ipv4_addr ip2,struct ipv4_addr mask)
{
uint32_t net1,net2,nmask;
- nmask = ntohl(mask.s_addr);
- net1 = ntohl(ip1.s_addr);
- net2 = ntohl(ip2.s_addr);
+ nmask = ntohl(mask.addr);
+ net1 = ntohl(ip1.addr);
+ net2 = ntohl(ip2.addr);
return((net1 & nmask) == (net2 & nmask));
}
diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c
index dbd71b58b6f..876698535ba 100644
--- a/source4/lib/util_sock.c
+++ b/source4/lib/util_sock.c
@@ -170,7 +170,7 @@ ssize_t read_udp_socket(int fd, char *buf, size_t len,
}
if (from_addr) {
- from_addr->s_addr = sock.sin_addr.s_addr;
+ from_addr->addr = sock.sin_addr.s_addr;
}
if (from_port) {
*from_port = ntohs(sock.sin_port);
@@ -512,7 +512,7 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
addr = interpret_addr2(p);
/* Look up the remote host name. */
- if ((hp = gethostbyaddr((char *)&addr.s_addr, sizeof(addr.s_addr), AF_INET)) == 0) {
+ if ((hp = gethostbyaddr((char *)&addr.addr, sizeof(addr.addr), AF_INET)) == 0) {
DEBUG(1,("Gethostbyaddr failed for %s\n",p));
name_buf = talloc_strdup(mem_ctx, p);
} else {
diff --git a/source4/lib/util_strlist.c b/source4/lib/util_strlist.c
index 0b32955ac20..db459b2f0fc 100644
--- a/source4/lib/util_strlist.c
+++ b/source4/lib/util_strlist.c
@@ -297,7 +297,7 @@ int ipstr_list_parse(const char* ipstr_list, struct ipv4_addr** ip_list)
struct ipv4_addr addr;
/* convert single token to ip address */
- if ( (addr.s_addr = sys_inet_addr(token_str)) == INADDR_NONE )
+ if ( (addr.addr = sys_inet_addr(token_str)) == INADDR_NONE )
break;
/* prepare place for another in_addr structure */