diff options
author | Olaf Kirch <okir@suse.de> | 2015-02-03 11:04:16 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-02-04 08:03:38 -0500 |
commit | 08d440ca9de46789163eefc37958e0131fdf9c14 (patch) | |
tree | 3f768fa377e236ab996c18c93332a695b359245e | |
parent | 52fbdcba91df95ef342949a958f00bc0470f5777 (diff) | |
download | rpcbind-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.c | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -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))) { |