Skip to content

Commit

Permalink
removed an unused function.
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmei committed May 1, 2002
1 parent 02f8adf commit c33b570
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
39 changes: 4 additions & 35 deletions kame/kame/dhcp6/common.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: common.c,v 1.36 2002/05/01 08:05:07 jinmei Exp $ */
/* $KAME: common.c,v 1.37 2002/05/01 10:53:46 jinmei Exp $ */
/*
* Copyright (C) 1998 and 1999 WIDE Project.
* All rights reserved.
Expand Down Expand Up @@ -246,47 +246,16 @@ transmit_sa(s, sa, hlim, buf, len)
hlim = 64;
if (setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &hlim,
sizeof(hlim)) < 0) {
err(1, "setsockopt(IPV6_MULTICAST_HOPS)");
/*NOTREACHED*/
dprintf(LOG_ERR, "setsockopt(IPV6_MULTICAST_HOPS): %s",
strerror(errno));
exit(1); /* XXX */
}

error = sendto(s, buf, len, 0, sa, sa->sa_len);

return (error != len) ? -1 : 0;
}

int
transmit(s, addr, port, hlim, buf, len)
int s;
char *addr;
char *port;
int hlim;
char *buf;
size_t len;
{
struct addrinfo hints, *res;
int error;

memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET6;
hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo(addr, port, &hints, &res);
if (error) {
errx(1, "getaddrinfo(%s): %s", addr, gai_strerror(error));
/*NOTREACHED*/
}
if (res->ai_next) {
errx(1, "getaddrinfo(%s): %s", addr,
"resolved to multiple addrs");
/*NOTREACHED*/
}

error = transmit_sa(s, res->ai_addr, hlim, buf, len);

freeaddrinfo(res);
return error;
}

long
random_between(x, y)
long x;
Expand Down
3 changes: 1 addition & 2 deletions kame/kame/dhcp6/common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: common.h,v 1.17 2002/05/01 08:05:07 jinmei Exp $ */
/* $KAME: common.h,v 1.18 2002/05/01 10:53:46 jinmei Exp $ */
/*
* Copyright (C) 1998 and 1999 WIDE Project.
* All rights reserved.
Expand Down Expand Up @@ -39,7 +39,6 @@ extern char *device;
extern int getifaddr __P((struct in6_addr *, char *, struct in6_addr *,
int, int, int));
extern int transmit_sa __P((int, struct sockaddr *, int, char *, size_t));
extern int transmit __P((int, char *, char *, int, char *, size_t));
extern long random_between __P((long, long));
extern char *addr2str __P((struct sockaddr *));
extern char *in6addr2str __P((struct in6_addr *, int));
Expand Down

0 comments on commit c33b570

Please sign in to comment.