socket's first argument is an address family, not a protocol family.
This commit is contained in:
parent
d056f34b36
commit
414245183e
@ -112,7 +112,7 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s)
|
||||
inet_ntoa(addr));
|
||||
return 0;
|
||||
}
|
||||
routes = ID0socket(PF_ROUTE, SOCK_RAW, AF_INET);
|
||||
routes = ID0socket(AF_ROUTE, SOCK_RAW, AF_INET);
|
||||
if (routes < 0) {
|
||||
log_Printf(LogERROR, "arp_SetProxy: opening routing socket: %s\n",
|
||||
strerror(errno));
|
||||
|
@ -184,7 +184,7 @@ atm_CreateDevice(struct physical *p, const char *iface, unsigned vpi,
|
||||
log_Printf(LogPHASE, "%s: Connecting to %s:%u.%u\n", p->link.name,
|
||||
iface, vpi, vci);
|
||||
|
||||
p->fd = socket(PF_NATM, SOCK_DGRAM, PROTO_NATMAAL5);
|
||||
p->fd = socket(AF_NATM, SOCK_DGRAM, PROTO_NATMAAL5);
|
||||
if (p->fd >= 0) {
|
||||
log_Printf(LogDEBUG, "%s: Opened atm socket %s\n", p->link.name,
|
||||
p->name.full);
|
||||
|
@ -1137,7 +1137,7 @@ mpserver_Open(struct mpserver *s, struct peerid *peer)
|
||||
|
||||
s->socket.sun_family = AF_LOCAL;
|
||||
s->socket.sun_len = sizeof s->socket;
|
||||
s->fd = ID0socket(PF_LOCAL, SOCK_DGRAM, 0);
|
||||
s->fd = ID0socket(AF_LOCAL, SOCK_DGRAM, 0);
|
||||
if (s->fd < 0) {
|
||||
log_Printf(LogERROR, "mpserver: socket(): %s\n", strerror(errno));
|
||||
return MPSERVER_FAILED;
|
||||
|
@ -723,7 +723,7 @@ rt_Set(struct bundle *bundle, int cmd, const struct ncprange *dst,
|
||||
cmdstr = (cmd == RTM_ADD ? "Add!" : "Delete!");
|
||||
else
|
||||
cmdstr = (cmd == RTM_ADD ? "Add" : "Delete");
|
||||
s = ID0socket(PF_ROUTE, SOCK_RAW, 0);
|
||||
s = ID0socket(AF_ROUTE, SOCK_RAW, 0);
|
||||
if (s < 0) {
|
||||
log_Printf(LogERROR, "rt_Set: socket(): %s\n", strerror(errno));
|
||||
return result;
|
||||
@ -835,7 +835,7 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst,
|
||||
char *p;
|
||||
int s, wb;
|
||||
|
||||
s = ID0socket(PF_ROUTE, SOCK_RAW, 0);
|
||||
s = ID0socket(AF_ROUTE, SOCK_RAW, 0);
|
||||
if (s < 0) {
|
||||
log_Printf(LogERROR, "rt_Update: socket(): %s\n", strerror(errno));
|
||||
return;
|
||||
|
@ -259,7 +259,7 @@ server_LocalOpen(struct bundle *bundle, const char *name, mode_t mask)
|
||||
ifsun.sun_family = AF_LOCAL;
|
||||
strcpy(ifsun.sun_path, name);
|
||||
|
||||
s = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||
s = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||
if (s < 0) {
|
||||
log_Printf(LogERROR, "Local: socket: %s\n", strerror(errno));
|
||||
goto failed;
|
||||
@ -328,7 +328,7 @@ server_TcpOpen(struct bundle *bundle, u_short port)
|
||||
sin6->sin6_port = htons(port);
|
||||
sin6->sin6_len = (u_int8_t)sizeof ss;
|
||||
sz = sizeof *sin6;
|
||||
s = socket(PF_INET6, SOCK_STREAM, 0);
|
||||
s = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@ -337,7 +337,7 @@ server_TcpOpen(struct bundle *bundle, u_short port)
|
||||
sin->sin_len = (u_int8_t)sizeof ss;
|
||||
sin->sin_addr.s_addr = INADDR_ANY;
|
||||
sz = sizeof *sin;
|
||||
s = socket(PF_INET, SOCK_STREAM, 0);
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
}
|
||||
|
||||
if (s < 0) {
|
||||
|
@ -84,7 +84,7 @@ tcp_OpenConnection(const char *name, char *host, char *port)
|
||||
}
|
||||
log_Printf(LogPHASE, "%s: Connecting to %s:%s/tcp\n", name, host, port);
|
||||
|
||||
sock = socket(PF_INET, SOCK_STREAM, 0);
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
return -2;
|
||||
|
||||
|
@ -229,7 +229,7 @@ udp_CreateDevice(struct physical *p, char *host, char *port)
|
||||
log_Printf(LogPHASE, "%s: Connecting to %s:%s/udp\n", p->link.name,
|
||||
host, port);
|
||||
|
||||
p->fd = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
p->fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (p->fd >= 0) {
|
||||
log_Printf(LogDEBUG, "%s: Opened udp socket %s\n", p->link.name,
|
||||
p->name.full);
|
||||
|
Loading…
x
Reference in New Issue
Block a user