summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2009-01-14 20:05:09 +0000
committerKen Raeburn <raeburn@mit.edu>2009-01-14 20:05:09 +0000
commit17c8e77afa8a513f6ad5b5364a7928d3a9c18b6f (patch)
tree8f0b7a1c7afd5a26e49682eaf5ad5b064678f0ff
parent50679fdf318017bb3781e6d9c553f9878362894f (diff)
downloadkrb5-17c8e77afa8a513f6ad5b5364a7928d3a9c18b6f.tar.gz
krb5-17c8e77afa8a513f6ad5b5364a7928d3a9c18b6f.tar.xz
krb5-17c8e77afa8a513f6ad5b5364a7928d3a9c18b6f.zip
Merge some very simple points of divergence in the two copies of network.c -- enum ordering, whitespace,
duplicate macro definitions, unused code, 0 vs NULL... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21746 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/kadmin/server/network.c17
-rw-r--r--src/kdc/network.c28
2 files changed, 18 insertions, 27 deletions
diff --git a/src/kadmin/server/network.c b/src/kadmin/server/network.c
index d0f8afab89..14cfd46ad5 100644
--- a/src/kadmin/server/network.c
+++ b/src/kadmin/server/network.c
@@ -1,7 +1,7 @@
/*
* kadmin/server/network.c
*
- * Copyright 1990,2000,2007,2008 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2007,2008,2009 by the Massachusetts Institute of Technology.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
@@ -180,13 +180,16 @@ static const char *paddr (struct sockaddr *sa)
/* kadmin data. */
-enum kadm_conn_type { CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER,
- CONN_TCP, CONN_ROUTING, CONN_RPC_LISTENER, CONN_RPC };
+enum conn_type {
+ CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP,
+ CONN_RPC_LISTENER, CONN_RPC,
+ CONN_ROUTING
+};
/* Per-connection info. */
struct connection {
int fd;
- enum kadm_conn_type type;
+ enum conn_type type;
void (*service)(void *handle, struct connection *, const char *, int);
union {
/* Type-specific information. */
@@ -334,10 +337,6 @@ static krb5_error_code add_rpc_service(int port, u_long prognum, u_long versnum,
#define USE_AF AF_INET
#define USE_TYPE SOCK_DGRAM
-
-
-#define USE_AF AF_INET
-#define USE_TYPE SOCK_DGRAM
#define USE_PROTO 0
#define SOCKET_ERRNO errno
#include "foreachaddr.h"
@@ -351,7 +350,7 @@ struct socksetup {
};
static struct connection *
-add_fd (struct socksetup *data, int sock, enum kadm_conn_type conntype,
+add_fd (struct socksetup *data, int sock, enum conn_type conntype,
void (*service)(void *handle, struct connection *, const char *, int))
{
struct connection *newconn;
diff --git a/src/kdc/network.c b/src/kdc/network.c
index 98f074cce7..56799522c6 100644
--- a/src/kdc/network.c
+++ b/src/kdc/network.c
@@ -1,7 +1,7 @@
/*
* kdc/network.c
*
- * Copyright 1990,2000,2007,2008 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2007,2008,2009 by the Massachusetts Institute of Technology.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
@@ -175,26 +175,18 @@ static const char *paddr (struct sockaddr *sa)
/* KDC data. */
-enum kdc_conn_type { CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP, CONN_ROUTING };
+enum conn_type {
+ CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP,
+ CONN_ROUTING
+};
/* Per-connection info. */
struct connection {
int fd;
- enum kdc_conn_type type;
+ enum conn_type type;
void (*service)(struct connection *, const char *, int);
union {
/* Type-specific information. */
-#if 0
- struct {
- int x;
- } udp;
- struct {
- int x;
- } udp_pktinfo;
- struct {
- int x;
- } tcp_listener;
-#endif
struct {
/* connection */
struct sockaddr_storage addr_s;
@@ -316,7 +308,7 @@ struct socksetup {
};
static struct connection *
-add_fd (struct socksetup *data, int sock, enum kdc_conn_type conntype,
+add_fd (struct socksetup *data, int sock, enum conn_type conntype,
void (*service)(struct connection *, const char *, int))
{
struct connection *newconn;
@@ -527,7 +519,7 @@ setup_tcp_listener_ports(struct socksetup *data)
/* Sockets are created, prepare to listen on them. */
if (s4 >= 0) {
- if (add_tcp_listener_fd(data, s4) == 0)
+ if (add_tcp_listener_fd(data, s4) == NULL)
close(s4);
else {
FD_SET(s4, &sstate.rfds);
@@ -539,7 +531,7 @@ setup_tcp_listener_ports(struct socksetup *data)
}
#ifdef KRB5_USE_INET6
if (s6 >= 0) {
- if (add_tcp_listener_fd(data, s6) == 0) {
+ if (add_tcp_listener_fd(data, s6) == NULL) {
close(s6);
s6 = -1;
} else {
@@ -1306,7 +1298,7 @@ static void accept_tcp_connection(struct connection *conn, const char *prog,
sockdata.retval = 0;
newconn = add_tcp_data_fd(&sockdata, s);
- if (newconn == 0)
+ if (newconn == NULL)
return;
if (getnameinfo((struct sockaddr *)&addr_s, addrlen,