summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2015-02-03 11:04:16 -0500
committerSteve Dickson <steved@redhat.com>2015-02-04 08:03:38 -0500
commit08d440ca9de46789163eefc37958e0131fdf9c14 (patch)
tree3f768fa377e236ab996c18c93332a695b359245e
parent52fbdcba91df95ef342949a958f00bc0470f5777 (diff)
downloadrpcbind-08d440ca9de46789163eefc37958e0131fdf9c14.tar.gz
Remove obsolete function in6_fillscopeid
This seems to be an old remnant from the very early days of IPv6 when the kernel would include the ifindex in the link-local addresses returned by getifaddrs(). This is no longer the case on Linux, so the code is a no-op. A no-op that makes gcc throw warnings about illegal type-punning. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/util.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/util.c b/src/util.c
index 7d56479..a6c835b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -71,9 +71,6 @@ static struct sockaddr_in6 *local_in6;
#endif
static int bitmaskcmp __P((void *, void *, void *, int));
-#ifdef INET6
-static void in6_fillscopeid __P((struct sockaddr_in6 *));
-#endif
/*
* For all bits set in "mask", compare the corresponding bits in
@@ -93,28 +90,6 @@ bitmaskcmp(void *dst, void *src, void *mask, int bytelen)
}
/*
- * Similar to code in ifconfig.c. Fill in the scope ID for link-local
- * addresses returned by getifaddrs().
- */
-#ifdef INET6
-static void
-in6_fillscopeid(struct sockaddr_in6 *sin6)
-{
- u_int16_t ifindex;
- u_int16_t *addr;
-
- if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
- addr = (u_int16_t *)&sin6->sin6_addr.s6_addr[2];
- ifindex = ntohs(*addr);
- if (sin6->sin6_scope_id == 0 && ifindex != 0) {
- sin6->sin6_scope_id = ifindex;
- *addr = 0;
- }
- }
-}
-#endif
-
-/*
* Find a server address that can be used by `caller' to contact
* the local service specified by `serv_uaddr'. If `clnt_uaddr' is
* non-NULL, it is used instead of `caller' as a hint suggesting
@@ -211,7 +186,6 @@ addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
* a link-local address then use the scope id to see
* which one.
*/
- in6_fillscopeid(SA2SIN6(ifsa));
if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa)) &&
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) &&
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) {