From 16837d2d217061001d2c4e743d4b81237deb194c Mon Sep 17 00:00:00 2001 From: SUZUKI Shinsuke Date: Fri, 19 Apr 2002 11:39:54 +0000 Subject: [PATCH] Explicitly specifies sin6_family & sin6_len of sockaddr_in6 for raw socket destination. (Currently lack of their specification does not lead to any problem, because kernel does not check the consistency between actual address and its address family / length on raw socket. However kernel should always check their consistency and stop sending packets if there is a contradiction. Considering backward compatibility of programs, I just fixed rtsol now; I'd like to fix the kernel behavior later.) Reviewed by: ume MFC after: 3 days --- usr.sbin/rtsold/rtsol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 62a73d00ae8..5086ea90bbb 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -1,4 +1,4 @@ -/* $KAME: rtsol.c,v 1.11 2000/08/13 06:14:59 itojun Exp $ */ +/* $KAME: rtsol.c,v 1.12 2001/11/12 11:47:11 jinmei Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -92,6 +92,8 @@ sockopen() return(-1); } memset(&sin6_allrouters, 0, sizeof(struct sockaddr_in6)); + sin6_allrouters.sin6_family = AF_INET6; + sin6_allrouters.sin6_len = sizeof(sin6_allrouters); if (inet_pton(AF_INET6, ALLROUTER, &sin6_allrouters.sin6_addr.s6_addr) != 1) { warnmsg(LOG_ERR, __FUNCTION__, "inet_pton failed for %s",