summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-08-03 19:36:06 +0000
committerMartin Mares <mj@ucw.cz>1999-08-03 19:36:06 +0000
commitdce267832a0468ed5e596f0b0733b926af7ead3a (patch)
tree76de529a85a81b12bd04ed150db208b76b0b17b1 /sysdep
parent707ef833783ef731c56baae1c0dc7b7a9e7321ff (diff)
Basic support for IPv6. The system-dependent part doesn't work yet,
but the core routines are there and seem to be working. o lib/ipv6.[ch] written o Lexical analyser recognizes IPv6 addresses and when in IPv6 mode, treats pure IPv4 addresses as router IDs. o Router ID must be configured manually on IPv6 systems. o Added SCOPE_ORGANIZATION for org-scoped IPv6 multicasts. o Fixed few places where ipa_(hton|ntoh) was called as a function returning converted address.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/cf/linux-v6.h9
-rw-r--r--sysdep/linux/netlink/netlink.c13
-rw-r--r--sysdep/unix/io.c4
3 files changed, 17 insertions, 9 deletions
diff --git a/sysdep/cf/linux-v6.h b/sysdep/cf/linux-v6.h
index 69ab0f8f..ef52ee46 100644
--- a/sysdep/cf/linux-v6.h
+++ b/sysdep/cf/linux-v6.h
@@ -8,9 +8,16 @@
#define IPV6
-#define CONFIG_TOS
#define CONFIG_AUTO_ROUTES
#define CONFIG_ALL_MULTICAST
+#define CONFIG_SELF_CONSCIOUS
+
+/*
+ * Netlink supports multiple tables, but kernel IPv6 code doesn't, so we
+ * treat it as a multiple table system with number of tables set to 1.
+ */
+#define CONFIG_MULTIPLE_TABLES
+#define CONFIG_ALL_TABLES_AT_ONCE
/*
Link: sysdep/linux/netlink
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index 6682dbc2..f71f1f5e 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -242,7 +242,7 @@ nl_add_attr_ipa(struct nlmsghdr *h, unsigned maxsize, int code, ip_addr ipa)
a = (struct rtattr *)((char *)h + NLMSG_ALIGN(h->nlmsg_len));
a->rta_type = code;
a->rta_len = len;
- ipa = ipa_hton(ipa);
+ ipa_hton(ipa);
memcpy(RTA_DATA(a), &ipa, sizeof(ipa));
h->nlmsg_len = NLMSG_ALIGN(h->nlmsg_len) + len;
}
@@ -351,17 +351,18 @@ nl_parse_addr(struct nlmsghdr *h)
if (i->ifa_flags & IFA_F_SECONDARY)
ifa.flags |= IA_SECONDARY;
memcpy(&ifa.ip, RTA_DATA(a[IFA_LOCAL]), sizeof(ifa.ip));
- ifa.ip = ipa_ntoh(ifa.ip);
+ ipa_ntoh(ifa.ip);
ifa.pxlen = i->ifa_prefixlen;
if (ifi->flags & IF_UNNUMBERED)
{
memcpy(&ifa.opposite, RTA_DATA(a[IFA_ADDRESS]), sizeof(ifa.opposite));
- ifa.opposite = ifa.brd = ipa_ntoh(ifa.opposite);
+ ipa_ntoh(ifa.opposite);
+ ifa.brd = ifa.opposite;
}
else if ((ifi->flags & IF_BROADCAST) && a[IFA_BROADCAST])
{
memcpy(&ifa.brd, RTA_DATA(a[IFA_BROADCAST]), sizeof(ifa.brd));
- ifa.brd = ipa_ntoh(ifa.brd);
+ ipa_ntoh(ifa.brd);
}
/* else a NBMA link */
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(ifa.pxlen));
@@ -575,7 +576,7 @@ nl_parse_route(struct nlmsghdr *h, int scan)
if (a[RTA_DST])
{
memcpy(&dst, RTA_DATA(a[RTA_DST]), sizeof(dst));
- dst = ipa_ntoh(dst);
+ ipa_ntoh(dst);
}
else
dst = IPA_NONE;
@@ -630,7 +631,7 @@ nl_parse_route(struct nlmsghdr *h, int scan)
neighbor *ng;
ra.dest = RTD_ROUTER;
memcpy(&ra.gw, RTA_DATA(a[RTA_GATEWAY]), sizeof(ra.gw));
- ra.gw = ipa_ntoh(ra.gw);
+ ipa_ntoh(ra.gw);
ng = neigh_find(&p->p, &ra.gw, 0);
if (ng)
ra.iface = ng->iface;
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 39cf200f..3e070fa1 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -314,7 +314,7 @@ sk_new(pool *p)
static inline void
set_inaddr(struct in_addr *ia, ip_addr a)
{
- a = ipa_hton(a);
+ ipa_hton(a);
memcpy(&ia->s_addr, &a, sizeof(a));
}
@@ -334,7 +334,7 @@ get_sockaddr(struct sockaddr_in *sa, ip_addr *a, unsigned *port)
if (port)
*port = ntohs(sa->sin_port);
memcpy(a, &sa->sin_addr.s_addr, sizeof(*a));
- *a = ipa_ntoh(*a);
+ ipa_ntoh(*a);
}
static char *