svn commit: r258416 - user/ae/inet6/sys/net
Andrey V. Elsukov
ae at FreeBSD.org
Thu Nov 21 02:54:58 UTC 2013
Author: ae
Date: Thu Nov 21 02:54:58 2013
New Revision: 258416
URL: http://svnweb.freebsd.org/changeset/base/258416
Log:
Check and initialize zone ids of src/dst addresses before calling
gif_set_tunnel. Also remove sa6_embedscope() calls.
Modified:
user/ae/inet6/sys/net/if_gif.c
Modified: user/ae/inet6/sys/net/if_gif.c
==============================================================================
--- user/ae/inet6/sys/net/if_gif.c Thu Nov 21 02:45:36 2013 (r258415)
+++ user/ae/inet6/sys/net/if_gif.c Thu Nov 21 02:54:58 2013 (r258416)
@@ -747,6 +747,10 @@ gif_ioctl(ifp, cmd, data)
case AF_INET6:
if (src->sa_len != sizeof(struct sockaddr_in6))
return EINVAL;
+ error = sa6_checkzone_ifp(ifp,
+ (struct sockaddr_in6 *)src);
+ if (error)
+ return (error);
break;
#endif
default:
@@ -763,6 +767,10 @@ gif_ioctl(ifp, cmd, data)
case AF_INET6:
if (dst->sa_len != sizeof(struct sockaddr_in6))
return EINVAL;
+ error = sa6_checkzone_ifp(ifp,
+ (struct sockaddr_in6 *)dst);
+ if (error)
+ return (error);
break;
#endif
default:
@@ -985,16 +993,6 @@ gif_set_tunnel(ifp, src, dst)
#endif
#ifdef INET6
case AF_INET6:
- /*
- * Check validity of the scope zone ID of the addresses, and
- * convert it into the kernel internal form if necessary.
- */
- error = sa6_embedscope((struct sockaddr_in6 *)sc->gif_psrc, 0);
- if (error != 0)
- break;
- error = sa6_embedscope((struct sockaddr_in6 *)sc->gif_pdst, 0);
- if (error != 0)
- break;
error = in6_gif_attach(sc);
break;
#endif
More information about the svn-src-user
mailing list