Module Name: src Committed By: pooka Date: Tue May 26 16:03:24 UTC 2009
Modified Files: src/sbin/ifconfig: Makefile env.h ifconfig.c Log Message: Add compile mode which executes rump system calls. This is useful when figuring out Where In The Kernel Is Carmen Sandiego's ioctl for an ifconfig command line, since we can simply single-step into the kernel. Activated by "make RUMP_ACTION=1". No changes to normal case. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sbin/ifconfig/Makefile cvs rdiff -u -r1.1 -r1.2 src/sbin/ifconfig/env.h cvs rdiff -u -r1.218 -r1.219 src/sbin/ifconfig/ifconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/ifconfig/Makefile diff -u src/sbin/ifconfig/Makefile:1.41 src/sbin/ifconfig/Makefile:1.42 --- src/sbin/ifconfig/Makefile:1.41 Sat Apr 11 07:58:12 2009 +++ src/sbin/ifconfig/Makefile Tue May 26 16:03:24 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.41 2009/04/11 07:58:12 lukem Exp $ +# $NetBSD: Makefile,v 1.42 2009/05/26 16:03:24 pooka Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # when making a change to this file, please check if the change is @@ -22,4 +22,16 @@ COPTS.ifconfig.c+= -fno-loop-optimize .endif +# +# Compile-time debug flag. If compiled with "make RUMP_ACTION=1", +# make rump system calls. This allows to single-step ioctl commands +# to figure out where ioctl's go in the kernel. +# +.ifdef RUMP_ACTION +CPPFLAGS+= -DRUMP_SYS_NETWORKING -DRUMP_SYS_IOCTL -DRUMP_ACTION +LDADD+= -lrumpnet_virtif -lrumpnet_netinet -lrumpnet_net -lrumpnet +LDADD+= -lrump -lrumpuser -lpthread +DBG= -g +.endif + .include <bsd.prog.mk> Index: src/sbin/ifconfig/env.h diff -u src/sbin/ifconfig/env.h:1.1 src/sbin/ifconfig/env.h:1.2 --- src/sbin/ifconfig/env.h:1.1 Tue May 6 04:33:42 2008 +++ src/sbin/ifconfig/env.h Tue May 26 16:03:24 2009 @@ -11,4 +11,14 @@ const char *getifinfo(prop_dictionary_t, prop_dictionary_t, unsigned short *); prop_dictionary_t prop_dictionary_augment(prop_dictionary_t, prop_dictionary_t); +/* + * XXX: this really doesn't belong in here, but env.h is conveniently + * included from all source modules *after* system headers, so it + * allows us to be lazy. See Makefile for more details. + */ +#ifdef RUMP_ACTION +#include <rump/rump.h> +#include <rump/rump_syscalls.h> +#endif /* RUMP_ACTION */ + #endif /* _IFCONFIG_ENV_H */ Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.218 src/sbin/ifconfig/ifconfig.c:1.219 --- src/sbin/ifconfig/ifconfig.c:1.218 Tue Apr 21 22:46:39 2009 +++ src/sbin/ifconfig/ifconfig.c Tue May 26 16:03:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.218 2009/04/21 22:46:39 dyoung Exp $ */ +/* $NetBSD: ifconfig.c,v 1.219 2009/05/26 16:03:24 pooka Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.218 2009/04/21 22:46:39 dyoung Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.219 2009/05/26 16:03:24 pooka Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -540,6 +540,9 @@ prop_dictionary_t env, oenv; const char *ifname; +#ifdef RUMP_ACTION + rump_init(); +#endif memset(match, 0, sizeof(match)); init_afs();