From 726f9b2bbdd5a607f7b0a10a64547739b807e361 Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 25 May 2003 21:04:54 +0000 Subject: Last fixes from 6Wind patch. --- lib/command.c | 11 +++++++++++ lib/sockunion.c | 5 +++++ lib/zebra.h | 4 ++++ 3 files changed, 20 insertions(+) (limited to 'lib') diff --git a/lib/command.c b/lib/command.c index f57cf5ca..5d429338 100644 --- a/lib/command.c +++ b/lib/command.c @@ -718,6 +718,8 @@ cmd_ipv6_match (char *str) int state = STATE_START; int colons = 0, nums = 0, double_colon = 0; char *sp = NULL; + struct sockaddr_in6 sin6_dummy; + int ret; if (str == NULL) return partly_match; @@ -725,6 +727,15 @@ cmd_ipv6_match (char *str) if (strspn (str, IPV6_ADDR_STR) != strlen (str)) return no_match; + /* use inet_pton that has a better support, + * for example inet_pton can support the automatic addresses: + * ::1.2.3.4 + */ + ret = inet_pton(AF_INET6, str, &sin6_dummy.sin6_addr); + + if (ret == 1) + return exact_match; + while (*str != '\0') { switch (state) diff --git a/lib/sockunion.c b/lib/sockunion.c index 13b0be6b..e4b311c7 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -344,8 +344,13 @@ sockunion_connect (int fd, union sockunion *peersu, unsigned short port, { #ifdef HAVE_SIN6_SCOPE_ID /* su.sin6.sin6_scope_id = ifindex; */ +#ifdef MUSICA + su.sin6.sin6_scope_id = ifindex; +#endif #endif /* HAVE_SIN6_SCOPE_ID */ +#ifndef MUSICA SET_IN6_LINKLOCAL_IFINDEX (su.sin6.sin6_addr, ifindex); +#endif } #endif /* KAME */ break; diff --git a/lib/zebra.h b/lib/zebra.h index 175eb6e2..baad6d6a 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -143,6 +143,10 @@ typedef int socklen_t; #include #endif /* HAVE_NETINET_IN_VAR_H */ +#ifdef HAVE_NETINET6_IN6_VAR_H +#include +#endif /* HAVE_NETINET6_IN6_VAR_H */ + #ifdef HAVE_NETINET_IN6_VAR_H #include #endif /* HAVE_NETINET_IN6_VAR_H */ -- cgit v1.2.1