Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/ifconfig/ifpfsync.c
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | setpfsync_syncpeer(const char *val, int d, int s, const struct afswtch *rafp) | ||||
if (peerres->ai_addr->sa_family != AF_INET) | if (peerres->ai_addr->sa_family != AF_INET) | ||||
errx(1, "only IPv4 addresses supported for the syncpeer"); | errx(1, "only IPv4 addresses supported for the syncpeer"); | ||||
preq.pfsyncr_syncpeer.s_addr = ((struct sockaddr_in *) | preq.pfsyncr_syncpeer.s_addr = ((struct sockaddr_in *) | ||||
peerres->ai_addr)->sin_addr.s_addr; | peerres->ai_addr)->sin_addr.s_addr; | ||||
if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1) | if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1) | ||||
err(1, "SIOCSETPFSYNC"); | err(1, "SIOCSETPFSYNC"); | ||||
freeaddrinfo(peerres); | |||||
} | } | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
void | void | ||||
unsetpfsync_syncpeer(const char *val, int d, int s, const struct afswtch *rafp) | unsetpfsync_syncpeer(const char *val, int d, int s, const struct afswtch *rafp) | ||||
{ | { | ||||
struct pfsyncreq preq; | struct pfsyncreq preq; | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |