mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Fix most cases where the address of an int is passed to a function expecting a
socklen_t * argument.
This commit is contained in:
parent
6aac4c27da
commit
78e3eed071
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141918
@ -605,7 +605,7 @@ res_send(buf, buflen, ans, anssiz)
|
||||
struct timespec ts;
|
||||
struct timeval timeout, ctv;
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
if (s < 0 || vc || af != nsap->sa_family) {
|
||||
if (vc)
|
||||
|
@ -256,9 +256,8 @@ conn_server(struct tac_handle *h)
|
||||
struct timeval tv;
|
||||
int nfds;
|
||||
struct sockaddr peer;
|
||||
int peerlen;
|
||||
socklen_t errlen, peerlen;
|
||||
int err;
|
||||
int errlen;
|
||||
|
||||
/* Wait for the connection to complete. */
|
||||
FD_ZERO(&wfds);
|
||||
|
@ -185,7 +185,8 @@ main(argc, argv)
|
||||
struct servent *servp;
|
||||
struct hostent *hep;
|
||||
char *stmp;
|
||||
int n, ba_len, ra_len;
|
||||
socklen_t ba_len, ra_len;
|
||||
int n;
|
||||
int nfound;
|
||||
fd_set readfds;
|
||||
int standalone;
|
||||
|
@ -88,8 +88,8 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct sockaddr_in from;
|
||||
socklen_t fromlen;
|
||||
int cc;
|
||||
int fromlen;
|
||||
char msgbuf[256];
|
||||
|
||||
/* verify proper invocation */
|
||||
|
@ -71,7 +71,8 @@ main(int argc, char *argv[])
|
||||
int ch;
|
||||
char *lp;
|
||||
struct sockaddr_storage ss;
|
||||
int p[2], logging, pflag, secure, sval;
|
||||
socklen_t sval;
|
||||
int p[2], logging, pflag, secure;
|
||||
#define ENTRIES 50
|
||||
char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog;
|
||||
char rhost[MAXHOSTNAMELEN];
|
||||
|
@ -270,7 +270,8 @@ static int *socksetup(int, char *, const char *);
|
||||
int
|
||||
main(int argc, char *argv[], char **envp)
|
||||
{
|
||||
int addrlen, ch, on = 1, tos;
|
||||
socklen_t addrlen;
|
||||
int ch, on = 1, tos;
|
||||
char *cp, line[LINE_MAX];
|
||||
FILE *fd;
|
||||
char *bindname = NULL;
|
||||
@ -1900,8 +1901,8 @@ dataconn(char *name, off_t size, char *mode)
|
||||
*sizebuf = '\0';
|
||||
if (pdata >= 0) {
|
||||
union sockunion from;
|
||||
int flags;
|
||||
int s, fromlen = ctrl_addr.su_len;
|
||||
socklen_t fromlen = ctrl_addr.su_len;
|
||||
int flags, s;
|
||||
struct timeval timeout;
|
||||
fd_set set;
|
||||
|
||||
@ -2816,7 +2817,8 @@ myoob(void)
|
||||
void
|
||||
passive(void)
|
||||
{
|
||||
int len, on;
|
||||
socklen_t len;
|
||||
int on;
|
||||
char *p, *a;
|
||||
|
||||
if (pdata >= 0) /* close old port if one set */
|
||||
@ -2899,7 +2901,8 @@ passive(void)
|
||||
void
|
||||
long_passive(char *cmd, int pf)
|
||||
{
|
||||
int len, on;
|
||||
socklen_t len;
|
||||
int on;
|
||||
char *p, *a;
|
||||
|
||||
if (pdata >= 0) /* close old port if one set */
|
||||
|
@ -99,7 +99,7 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
int ch;
|
||||
|
||||
openlog("rexecd", LOG_PID, LOG_AUTH);
|
||||
|
@ -140,7 +140,8 @@ main(int argc, char *argv[])
|
||||
{
|
||||
extern int __check_rhosts_file;
|
||||
union sockunion from;
|
||||
int ch, fromlen, on;
|
||||
socklen_t fromlen;
|
||||
int ch, on;
|
||||
|
||||
openlog("rlogind", LOG_PID | LOG_CONS, LOG_AUTH);
|
||||
|
||||
@ -242,7 +243,8 @@ doit(int f, union sockunion *fromp)
|
||||
if (fromp->su_family == AF_INET)
|
||||
{
|
||||
u_char optbuf[BUFSIZ/3];
|
||||
int optsize = sizeof(optbuf), ipproto, i;
|
||||
socklen_t optsize = sizeof(optbuf);
|
||||
int ipproto, i;
|
||||
struct protoent *ip;
|
||||
|
||||
if ((ip = getprotobyname("ip")) != NULL)
|
||||
|
@ -69,7 +69,7 @@ main(int argc, char *argv[])
|
||||
SVCXPRT *transp;
|
||||
int ok;
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
fromlen = sizeof(from);
|
||||
if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
|
||||
|
@ -62,7 +62,7 @@ main(int argc, char *argv[])
|
||||
SVCXPRT *transp;
|
||||
int ok;
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
if (argc == 2)
|
||||
closedown = atoi(argv[1]);
|
||||
|
@ -63,7 +63,7 @@ main(int argc, char *argv[])
|
||||
SVCXPRT *transp;
|
||||
int ok;
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
/*
|
||||
* See if inetd started us
|
||||
|
@ -65,7 +65,8 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
SVCXPRT *transp;
|
||||
int ok, salen;
|
||||
socklen_t salen;
|
||||
int ok;
|
||||
struct sockaddr_storage sa;
|
||||
|
||||
if (argc == 2 && !strcmp(argv[1], "-n"))
|
||||
|
@ -78,7 +78,7 @@ main(int argc, char *argv[])
|
||||
SVCXPRT *transp;
|
||||
int ok;
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
/*
|
||||
* See if inetd started us
|
||||
|
@ -127,7 +127,8 @@ main(int argc, char *argv[])
|
||||
{
|
||||
extern int __check_rhosts_file;
|
||||
struct linger linger;
|
||||
int ch, on = 1, fromlen;
|
||||
socklen_t fromlen;
|
||||
int ch, on = 1;
|
||||
struct sockaddr_storage from;
|
||||
|
||||
openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
|
||||
@ -218,7 +219,7 @@ doit(struct sockaddr *fromp)
|
||||
#ifdef IP_OPTIONS
|
||||
if (af == AF_INET) {
|
||||
u_char optbuf[BUFSIZ/3];
|
||||
int optsize = sizeof(optbuf), ipproto, i;
|
||||
socklen_t optsize = sizeof(optbuf), ipproto, i;
|
||||
struct protoent *ip;
|
||||
|
||||
if ((ip = getprotobyname("ip")) != NULL)
|
||||
|
@ -261,7 +261,7 @@ synchnet(f)
|
||||
int i, j = 0;
|
||||
char rbuf[PKTSIZE];
|
||||
struct sockaddr_storage from;
|
||||
int fromlen;
|
||||
socklen_t fromlen;
|
||||
|
||||
while (1) {
|
||||
(void) ioctl(f, FIONREAD, &i);
|
||||
|
@ -264,7 +264,8 @@ main(int argc, char *argv[])
|
||||
}
|
||||
for (;;) {
|
||||
struct whod wd;
|
||||
int cc, whod, len = sizeof(from);
|
||||
socklen_t len = sizeof(from);
|
||||
int cc, whod;
|
||||
time_t t;
|
||||
|
||||
cc = recvfrom(s, (char *)&wd, sizeof(struct whod), 0,
|
||||
|
Loading…
Reference in New Issue
Block a user