summaryrefslogtreecommitdiffstats
path: root/interface.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-12 11:19:29 +0000
committerRoy Marples <roy@marples.name>2007-10-12 11:19:29 +0000
commita41c971c80cf3a50d252acc186bf0346ea86f7d6 (patch)
treedfb7eab3cf7ffb0ea5d53fd8d72a69c0e6f7f166 /interface.h
parent0c98f75b3738af5a2204cc0cf1a1177367dcf05e (diff)
downloaddhcpcd-a41c971c80cf3a50d252acc186bf0346ea86f7d6.tar.xz
Always add a link-local route unless we're given a non-private address by the DHCP server.
Diffstat (limited to 'interface.h')
-rw-r--r--interface.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/interface.h b/interface.h
index f3bf0505..59f5024f 100644
--- a/interface.h
+++ b/interface.h
@@ -51,7 +51,18 @@
# define ARPHRD_INFINIBAND 27
#endif
-#define HWADDR_LEN 20
+#define HWADDR_LEN 20
+
+/* Work out if we have a private address or not
+ * 10/8
+ * 172.16/12
+ * 192.168/16
+ */
+#ifndef IN_PRIVATE
+# define IN_PRIVATE(addr) (((ntohl (addr) & IN_CLASSA_NET) == 0x0a000000) || \
+ ((ntohl (addr) & 0xfff00000) == 0xac100000) || \
+ ((ntohl (addr) & IN_CLASSB_NET) == 0xc0a80000))
+#endif
typedef struct route_t
{