ARGSUSED */
| 94 | |
| 95 | /* ARGSUSED */ |
| 96 | void |
| 97 | setpfsync_syncpeer(const char *val, int d, int s, const struct afswtch *rafp) |
| 98 | { |
| 99 | struct pfsyncreq preq; |
| 100 | struct addrinfo hints, *peerres; |
| 101 | int ecode; |
| 102 | |
| 103 | bzero((char *)&preq, sizeof(struct pfsyncreq)); |
| 104 | ifr.ifr_data = (caddr_t)&preq; |
| 105 | |
| 106 | if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1) |
| 107 | err(1, "SIOCGETPFSYNC"); |
| 108 | |
| 109 | memset(&hints, 0, sizeof(hints)); |
| 110 | hints.ai_family = AF_INET; |
| 111 | hints.ai_socktype = SOCK_DGRAM; /*dummy*/ |
| 112 | |
| 113 | if ((ecode = getaddrinfo(val, NULL, &hints, &peerres)) != 0) |
| 114 | errx(1, "error in parsing address string: %s", |
| 115 | gai_strerror(ecode)); |
| 116 | |
| 117 | if (peerres->ai_addr->sa_family != AF_INET) |
| 118 | errx(1, "only IPv4 addresses supported for the syncpeer"); |
| 119 | |
| 120 | preq.pfsyncr_syncpeer.s_addr = ((struct sockaddr_in *) |
| 121 | peerres->ai_addr)->sin_addr.s_addr; |
| 122 | |
| 123 | if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1) |
| 124 | err(1, "SIOCSETPFSYNC"); |
| 125 | freeaddrinfo(peerres); |
| 126 | } |
| 127 | |
| 128 | /* ARGSUSED */ |
| 129 | void |
nothing calls this directly
no test coverage detected