Module Name:    src
Committed By:   martin
Date:           Sat Sep 21 12:34:07 UTC 2024

Modified Files:
        src/crypto/dist/ipsec-tools/src/racoon [netbsd-10]: grabmyaddr.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #906):

        crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c: revision 1.40

cast to the correct message structure (rt_msghdr instead of if_msghdr)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.6.1 \
    src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39.6.1
--- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39	Wed Nov 25 14:15:41 2020
+++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c	Sat Sep 21 12:34:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: grabmyaddr.c,v 1.39 2020/11/25 14:15:41 christos Exp $	*/
+/*	$NetBSD: grabmyaddr.c,v 1.39.6.1 2024/09/21 12:34:07 martin Exp $	*/
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * Copyright (C) 2008 Timo Teras <[email protected]>.
@@ -849,7 +849,7 @@ kernel_sync()
 {
 	caddr_t ref, buf, end;
 	size_t bufsiz;
-	struct if_msghdr *ifm;
+	struct rt_msghdr *rtm;
 
 #define MIBSIZ 6
 	int mib[MIBSIZ] = {
@@ -871,8 +871,10 @@ kernel_sync()
 
 	if (sysctl(mib, MIBSIZ, buf, &bufsiz, NULL, 0) >= 0) {
 		/* Parse both interfaces and addresses. */
-		for (end = buf + bufsiz; buf < end; buf += ifm->ifm_msglen) {
-			ifm = (struct if_msghdr *) buf;
+		for (end = buf + bufsiz; buf < end; buf += rtm->rtm_msglen) {
+			rtm = (struct rt_msghdr *) buf;
+			if (rtm->rtm_version != RTM_VERSION)
+				continue;
 			kernel_handle_message(buf);
 		}
 	} else {

Reply via email to