2014-01-30 15:01:34 +01:00
|
|
|
From f474754a2dee2f0b53435b79800611eebcdff2ac Mon Sep 17 00:00:00 2001
|
2014-01-15 11:14:08 +01:00
|
|
|
From: Olaf Kirch <okir@suse.de>
|
|
|
|
Date: Tue, 20 Aug 2013 11:43:51 +0200
|
2014-01-30 15:01:34 +01:00
|
|
|
Subject: [PATCH 05/24] Remove obsolete function in6_fillscopeid
|
2014-01-15 11:14:08 +01:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
|
|
|
src/util.c | 24 ------------------------
|
|
|
|
1 file changed, 24 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/util.c b/src/util.c
|
|
|
|
index 9a5fb69..a6c835b 100644
|
|
|
|
--- a/src/util.c
|
|
|
|
+++ b/src/util.c
|
2014-12-11 19:00:24 +01:00
|
|
|
@@ -71,9 +71,6 @@
|
2014-01-15 11:14:08 +01:00
|
|
|
#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
|
2014-12-11 19:00:24 +01:00
|
|
|
@@ -93,28 +90,6 @@
|
2014-01-15 11:14:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
- * 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;
|
2014-12-11 19:00:24 +01:00
|
|
|
- u_int16_t *addr;
|
2014-01-15 11:14:08 +01:00
|
|
|
-
|
|
|
|
- if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
2014-12-11 19:00:24 +01:00
|
|
|
- addr = (u_int16_t *)&sin6->sin6_addr.s6_addr[2];
|
|
|
|
- ifindex = ntohs(*addr);
|
2014-01-15 11:14:08 +01:00
|
|
|
- if (sin6->sin6_scope_id == 0 && ifindex != 0) {
|
|
|
|
- sin6->sin6_scope_id = ifindex;
|
2014-12-11 19:00:24 +01:00
|
|
|
- *addr = 0;
|
2014-01-15 11:14:08 +01:00
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-#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
|
2014-12-11 19:00:24 +01:00
|
|
|
@@ -211,7 +186,6 @@
|
2014-01-15 11:14:08 +01:00
|
|
|
* 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))) {
|
|
|
|
|