Re: [nc] rename sun to s_un (for building on Solaris)

2015-11-24 Thread Ali Polatel
Here goes the sun. It's all right.

Sorry, could not resist.

alip.

2015-11-24 21:30 GMT+02:00 Sebastian Benoit :

> Brent Cook(bust...@gmail.com) on 2015.11.22 16:32:49 -0600:
> >
> > Finally getting around to trying out nc on some more platforms for
> > LibreSSL-portable, and ran into Sun/Oracle's silly definition of 'sun'
> > in the system headers. OK to rename the local sockaddr_un variables?
>
> ok benno@
>
> > Portable contains a patch full of #ifdef's around other systems-specific
> > nc features (e.g. rdomain support). I'm not sure if any of those
> > should also move into cvs or stay in the portable patch.
>
> while for nc it might be fine (small programm etc) i would not like to have
> this elsewhere (i.e. ntpd, relayd, bgpd...) because it will make reading
> the
> code harder.
>
> i'm ok with restructuring our code a bit if it reduces your ifdef hell.
>
> > Index: netcat.c
> > ===
> > RCS file: /cvs/src/usr.bin/nc/netcat.c,v
> > retrieving revision 1.143
> > diff -u -p -u -p -r1.143 netcat.c
> > --- netcat.c  13 Nov 2015 18:13:13 -  1.143
> > +++ netcat.c  22 Nov 2015 22:26:08 -
> > @@ -643,7 +643,7 @@ main(int argc, char *argv[])
> >  int
> >  unix_bind(char *path, int flags)
> >  {
> > - struct sockaddr_un sun;
> > + struct sockaddr_un s_un;
> >   int s;
> >
> >   /* Create unix domain socket. */
> > @@ -651,17 +651,17 @@ unix_bind(char *path, int flags)
> >   0)) < 0)
> >   return (-1);
> >
> > - memset(, 0, sizeof(struct sockaddr_un));
> > - sun.sun_family = AF_UNIX;
> > + memset(_un, 0, sizeof(struct sockaddr_un));
> > + s_un.sun_family = AF_UNIX;
> >
> > - if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
> > - sizeof(sun.sun_path)) {
> > + if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >=
> > + sizeof(s_un.sun_path)) {
> >   close(s);
> >   errno = ENAMETOOLONG;
> >   return (-1);
> >   }
> >
> > - if (bind(s, (struct sockaddr *), sizeof(sun)) < 0) {
> > + if (bind(s, (struct sockaddr *)_un, sizeof(s_un)) < 0) {
> >   close(s);
> >   return (-1);
> >   }
> > @@ -737,7 +737,7 @@ tls_setup_server(struct tls *tls_ctx, in
> >  int
> >  unix_connect(char *path)
> >  {
> > - struct sockaddr_un sun;
> > + struct sockaddr_un s_un;
> >   int s;
> >
> >   if (uflag) {
> > @@ -748,16 +748,16 @@ unix_connect(char *path)
> >   return (-1);
> >   }
> >
> > - memset(, 0, sizeof(struct sockaddr_un));
> > - sun.sun_family = AF_UNIX;
> > + memset(_un, 0, sizeof(struct sockaddr_un));
> > + s_un.sun_family = AF_UNIX;
> >
> > - if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
> > - sizeof(sun.sun_path)) {
> > + if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >=
> > + sizeof(s_un.sun_path)) {
> >   close(s);
> >   errno = ENAMETOOLONG;
> >   return (-1);
> >   }
> > - if (connect(s, (struct sockaddr *), sizeof(sun)) < 0) {
> > + if (connect(s, (struct sockaddr *)_un, sizeof(s_un)) < 0) {
> >   close(s);
> >   return (-1);
> >   }
> >
>
> --
>
>


Re: [patch v2] cwm: Preserve stacking order during cycling

2015-11-24 Thread Vadim Vygonets
Quoth Артур Истомин on Tue, Nov 24, 2015:
> I'am on 5.8-stable =( It's failed:

Yeah, cwm changed quite a bit since the release.  (Maybe that's
why I don't see the problem with cycling?)  Updating the cwm
subtree should solve it without any harm.

Vadim.

-- 
The human mind treats a new idea the way the
body treats a strange protein: it rejects it.
-- P. Medawar



Re: [PATCH] doas authentication type

2015-11-24 Thread Richard Johnson

On 2015-08-27 11:16, Theo de Raadt wrote:

How many users of that functionality will there be?

We only need to concern ourselves with the cost; you have to justify
the benefit.  How many people were doing this with sudo, and how many
will need this with doas?



My current model is to use my yubikey when sudo'ing. Occasionally I find it
easier to use my password, and I make use of sudo -a passwd. Perhaps the
case for doas is to provide less features and if you need to be able to do
that, it's best to use sudo from ports?


I didn't question whether you are using it.  I asked how many people.
Are you avoiding the question by answering "1"?  Not all sensitive
software can do everything.  That's why the -backrub option from sudo
didn't make it to doas.



I'm torn. I would like -a, for my uses and users.  But I don't have a large 
installation.


I'm coming back to this (late) because an authserver being unreachable called 
my attention to doas not having -a.  I thus can't switch to it from the sudo 
port (where I presently have a broken -a).


We use 2-factor authn for sudo & doas, as well as for most logins. Presently, 
we transport Yubikey and other HOTP strings across RADIUS to an otpd 
authserver, and also have local S/Key configured for access when the otpd 
authserver is unreachable.


This is on systems with 1200+ user accounts, about 30 active daily.  Users 
expect that if they can log in as username:radius or username:skey, they 
should be able to sudo -a radius or sudo -a skey.


Moving away from Kerberos means possible increasing use of sudo or doas by 
regular users to run transfer commands to data archives.  For this, it would 
be useful if doas supported "-a skey".  Then I could just use doas; the 
command is otherwise plain enough.


But that's not a lot of users across the entire OpenBSD installed base.

Installing sudo from ports is still an option. I need to debug the -a failure 
there now. ;)



Richard



Re: [patch] cwm: Preserve stacking order during cycling

2015-11-24 Thread Артур Истомин
On Sun, Nov 22, 2015 at 05:56:09PM +0100, Vadim Vygonets wrote:
> День добрый,
> 
> Quoth Артур Истомин on Sun, Nov 22, 2015:
> > It is always reproducable for me when 3 or more windows opened. This
> > is not immediately, but eventualy I can't access to the window located
> > below one or two other through Alt+Tab.
> 
> Sorry to be so explicit, but just to make sure I understand you
> correctly: while holding Alt, you press Tab several times, and
> you get to the original window (the one you started with) without
> seeing one or more non-hidden windows in the process?

Yes, exactly. Example: https://imgur.com/rUPxpTF There is mplayer behind
firefox. In the beginning everything is working properly. Alt+Tab work for
all three windows. Some time later mplayer does not appear anymore through
Alt+Tab and i need to press Alt+Down, Alt+Down.

> 
> > It is very annoying, that Alt+Tab in cwm does not work in "classic"
> > way, cycling ALL windows in order.
> 
> It should (unless you remapped M-Tab or have "ignore" directives
> in your .cwmrc).  What you describe sounds like cwm losing
> windows, or marking them as hidden or ignored for some reason.
> 
> Do you notice any common conditions in which it happens?  E.g.,
> after hiding/showing groups, or after not doing it for a while?
> Do particular clients (programs) drop off the list more often, or
> does it happen when particular clients are shown?  What's your
> favourite client (i.e., what terminal emulator do you use)?  Do
> you have any surprises in your .cwmrc?

I don't see any common conditions. In my ~/.cwmrc only one line:

fontname "-xos4-terminus-medium-r-*-*-16-*-*-*-*-*-iso10646-1"



Re: [nc] rename sun to s_un (for building on Solaris)

2015-11-24 Thread Sebastian Benoit
Brent Cook(bust...@gmail.com) on 2015.11.22 16:32:49 -0600:
> 
> Finally getting around to trying out nc on some more platforms for
> LibreSSL-portable, and ran into Sun/Oracle's silly definition of 'sun'
> in the system headers. OK to rename the local sockaddr_un variables?

ok benno@
 
> Portable contains a patch full of #ifdef's around other systems-specific
> nc features (e.g. rdomain support). I'm not sure if any of those
> should also move into cvs or stay in the portable patch.

while for nc it might be fine (small programm etc) i would not like to have
this elsewhere (i.e. ntpd, relayd, bgpd...) because it will make reading the
code harder.

i'm ok with restructuring our code a bit if it reduces your ifdef hell.
 
> Index: netcat.c
> ===
> RCS file: /cvs/src/usr.bin/nc/netcat.c,v
> retrieving revision 1.143
> diff -u -p -u -p -r1.143 netcat.c
> --- netcat.c  13 Nov 2015 18:13:13 -  1.143
> +++ netcat.c  22 Nov 2015 22:26:08 -
> @@ -643,7 +643,7 @@ main(int argc, char *argv[])
>  int
>  unix_bind(char *path, int flags)
>  {
> - struct sockaddr_un sun;
> + struct sockaddr_un s_un;
>   int s;
> 
>   /* Create unix domain socket. */
> @@ -651,17 +651,17 @@ unix_bind(char *path, int flags)
>   0)) < 0)
>   return (-1);
> 
> - memset(, 0, sizeof(struct sockaddr_un));
> - sun.sun_family = AF_UNIX;
> + memset(_un, 0, sizeof(struct sockaddr_un));
> + s_un.sun_family = AF_UNIX;
> 
> - if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
> - sizeof(sun.sun_path)) {
> + if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >=
> + sizeof(s_un.sun_path)) {
>   close(s);
>   errno = ENAMETOOLONG;
>   return (-1);
>   }
> 
> - if (bind(s, (struct sockaddr *), sizeof(sun)) < 0) {
> + if (bind(s, (struct sockaddr *)_un, sizeof(s_un)) < 0) {
>   close(s);
>   return (-1);
>   }
> @@ -737,7 +737,7 @@ tls_setup_server(struct tls *tls_ctx, in
>  int
>  unix_connect(char *path)
>  {
> - struct sockaddr_un sun;
> + struct sockaddr_un s_un;
>   int s;
> 
>   if (uflag) {
> @@ -748,16 +748,16 @@ unix_connect(char *path)
>   return (-1);
>   }
> 
> - memset(, 0, sizeof(struct sockaddr_un));
> - sun.sun_family = AF_UNIX;
> + memset(_un, 0, sizeof(struct sockaddr_un));
> + s_un.sun_family = AF_UNIX;
> 
> - if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
> - sizeof(sun.sun_path)) {
> + if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >=
> + sizeof(s_un.sun_path)) {
>   close(s);
>   errno = ENAMETOOLONG;
>   return (-1);
>   }
> - if (connect(s, (struct sockaddr *), sizeof(sun)) < 0) {
> + if (connect(s, (struct sockaddr *)_un, sizeof(s_un)) < 0) {
>   close(s);
>   return (-1);
>   }
> 

-- 



UPDATE: xf86-input-keyboard 1.8.1

2015-11-24 Thread Alexandr Shadchin
Hi,

This diff updates xf86-input-keyboard to the latest release.
Tested on amd64.

Comments ? OK ?

-- 
Alexandr Shadchin



xf86-input-keyboard-1.8.1.tgz
Description: application/tar-gz


UPDATE: xf86-input-synaptics 1.8.3

2015-11-24 Thread Alexandr Shadchin
Hi,

This diff updates xf86-input-synaptics to the latest release.
Tested on amd64.

Comments ? OK ?

-- 
Alexandr Shadchin

Index: ChangeLog
===
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/ChangeLog,v
retrieving revision 1.10
diff -u -p -r1.10 ChangeLog
--- ChangeLog   11 Apr 2015 16:08:42 -  1.10
+++ ChangeLog   24 Nov 2015 08:28:47 -
@@ -1,3 +1,22 @@
+commit af7d8a15278a968d919bf539628281bf713f747b
+Author: Peter Hutterer 
+Date:   Thu Oct 29 12:10:09 2015 +1000
+
+synaptics 1.8.3
+
+Signed-off-by: Peter Hutterer 
+
+commit 3e7508ac087028f8f8e116f5279dad1ebcdc58e6
+Author: Gabriele Mazzotta 
+Date:   Thu Aug 14 20:03:42 2014 +0200
+
+Use cumulative relative touch movements while scrolling
+
+Signed-off-by: Gabriele Mazzotta 
+Reviewed-by: Peter Hutterer 
+Signed-off-by: Peter Hutterer 
+(cherry picked from commit ec0901e5f81d9cad6cc8bbdcb5ea075009c13de5)
+
 commit 6f8d4bac14ac8f3fd2714f0a8a9e37c5136a4013
 Author: Peter Hutterer 
 Date:   Fri Mar 27 11:26:55 2015 +1000
Index: configure
===
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/configure,v
retrieving revision 1.11
diff -u -p -r1.11 configure
--- configure   11 Apr 2015 16:08:42 -  1.11
+++ configure   24 Nov 2015 08:28:48 -
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xf86-input-synaptics 1.8.2.
+# Generated by GNU Autoconf 2.69 for xf86-input-synaptics 1.8.3.
 #
 # Report bugs to .
 #
@@ -591,8 +591,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='xf86-input-synaptics'
 PACKAGE_TARNAME='xf86-input-synaptics'
-PACKAGE_VERSION='1.8.2'
-PACKAGE_STRING='xf86-input-synaptics 1.8.2'
+PACKAGE_VERSION='1.8.3'
+PACKAGE_STRING='xf86-input-synaptics 1.8.3'
 PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
 PACKAGE_URL=''
 
@@ -1378,7 +1378,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xf86-input-synaptics 1.8.2 to adapt to many kinds of 
systems.
+\`configure' configures xf86-input-synaptics 1.8.3 to adapt to many kinds of 
systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1449,7 +1449,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-input-synaptics 1.8.2:";;
+ short | recursive ) echo "Configuration of xf86-input-synaptics 1.8.3:";;
esac
   cat <<\_ACEOF
 
@@ -1586,7 +1586,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xf86-input-synaptics configure 1.8.2
+xf86-input-synaptics configure 1.8.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1910,7 +1910,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xf86-input-synaptics $as_me 1.8.2, which was
+It was created by xf86-input-synaptics $as_me 1.8.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2739,7 +2739,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='xf86-input-synaptics'
- VERSION='1.8.2'
+ VERSION='1.8.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -18820,7 +18820,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xf86-input-synaptics $as_me 1.8.2, which was
+This file was extended by xf86-input-synaptics $as_me 1.8.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -18886,7 +18886,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-xf86-input-synaptics config.status 1.8.2
+xf86-input-synaptics config.status 1.8.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/configure.ac,v
retrieving revision 1.11
diff -u -p -r1.11 configure.ac
--- configure.ac11 Apr 2015 16:08:42 -  1.11
+++ configure.ac24 Nov 2015 08:28:48 -
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-  

Re: vi: default to tab for filename completion

2015-11-24 Thread Anthony J. Bentley
Gregor Best writes:
> On Mon, Nov 23, 2015 at 01:36:00AM -0700, Anthony J. Bentley wrote:
> > [...]
> 
> In addition to this, my ~/.exrc also sets cedit to tab. Would this
> make sense here as well? Currently it's disabled by default, but
> IMHO it's a useful feature for longer editing sessions.

An interesting feature, but I don't think it would be a sensible
default. Filename tab completion is intuitive but tab triggering
a window that contains command history you can scroll through is
not something I would expect by default.

-- 
Anthony J. Bentley



Change lseek to proper place on canfield(6)

2015-11-24 Thread Ricardo Mestre
Hi!

Sending patches while your better half is screaming doesn't work too well, 
tedu@ already commited my changes for canfield(6), but they had a few stupid 
lseek(), although still needed, that no one probably would notice except theo@

Since the score file now only has 1 record, instead of 1 record per each uid 
like before, then the lseek needs to point to the beginning of the file and 
additionally if there's a open(2) then the immediate lseek is not needed.

ndex: canfield/canfield.c
===
RCS file: /cvs/src/games/canfield/canfield/canfield.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 canfield.c
--- canfield/canfield.c 24 Nov 2015 02:53:39 -  1.17
+++ canfield/canfield.c 24 Nov 2015 10:59:32 -
@@ -1377,7 +1377,7 @@ suspend(void)
move(21, 0);
refresh();
if (dbfd != -1) {
-   lseek(dbfd, sizeof(struct betinfo), SEEK_SET);
+   lseek(dbfd, 0, SEEK_SET);
write(dbfd, (char *), sizeof(total));
}
kill(getpid(), SIGTSTP);
@@ -1635,12 +1635,6 @@ initall(void)
dbfd = open(scorepath, O_RDWR | O_CREAT, 0644);
if (dbfd < 0)
return;
-   i = lseek(dbfd, sizeof(struct betinfo), SEEK_SET);
-   if (i < 0) {
-   close(dbfd);
-   dbfd = -1;
-   return;
-   }
i = read(dbfd, (char *), sizeof(total));
if (i < 0) {
close(dbfd);
@@ -1698,7 +1692,7 @@ cleanup(int dummy)
status = NOBOX;
updatebettinginfo();
if (dbfd != -1) {
-   lseek(dbfd, sizeof(struct betinfo), SEEK_SET);
+   lseek(dbfd, 0, SEEK_SET);
write(dbfd, (char *), sizeof(total));
close(dbfd);
}
Index: cfscores/cfscores.c
===
RCS file: /cvs/src/games/canfield/cfscores/cfscores.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 cfscores.c
--- cfscores/cfscores.c 24 Nov 2015 02:53:39 -  1.17
+++ cfscores/cfscores.c 24 Nov 2015 10:59:43 -
@@ -91,11 +91,6 @@ printuser(const struct passwd *pw, int p
printf("Bad uid %u\n", pw->pw_uid);
return;
}
-   i = lseek(dbfd, sizeof(struct betinfo), SEEK_SET);
-   if (i < 0) {
-   warn("lseek %s", scorepath);
-   return;
-   }
i = read(dbfd, (char *), sizeof(total));
if (i < 0) {
warn("lseek %s", scorepath);



rt_ifp and ip6_getpmtu()

2015-11-24 Thread Martin Pieuchot
This does two things.  Prevent a NULL dereference in ip6_getpmtu() that
was introduced during the rdomain support addition.

Make use of if_get() instead of rt_ifp.

ok?

Index: netinet6/ip6_output.c
===
RCS file: /cvs/src/sys/netinet6/ip6_output.c,v
retrieving revision 1.199
diff -u -p -r1.199 ip6_output.c
--- netinet6/ip6_output.c   11 Nov 2015 10:23:23 -  1.199
+++ netinet6/ip6_output.c   19 Nov 2015 12:23:38 -
@@ -128,8 +128,8 @@ int ip6_insertfraghdr(struct mbuf *, str
struct ip6_frag **);
 int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t);
 int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *);
-int ip6_getpmtu(struct route_in6 *, struct route_in6 *,
-   struct ifnet *, struct in6_addr *, u_long *, int *);
+int ip6_getpmtu(struct route_in6 *, struct route_in6 *, struct ifnet *,
+unsigned int, struct in6_addr *, u_long *, int *);
 int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int);
 static __inline u_int16_t __attribute__((__unused__))
 in6_cksum_phdr(const struct in6_addr *, const struct in6_addr *,
@@ -646,8 +646,8 @@ reroute:
}
 
/* Determine path MTU. */
-   if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, , ,
-   )) != 0)
+   if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, ro->ro_tableid, ,
+   , )) != 0)
goto bad;
 
/*
@@ -,8 +,8 @@ ip6_insertfraghdr(struct mbuf *m0, struc
 }
 
 int
-ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro,
-struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp)
+ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, struct ifnet 
*ifp0,
+unsigned int rtableid, struct in6_addr *dst, u_long *mtup, int 
*alwaysfragp)
 {
u_int32_t mtu = 0;
int alwaysfrag = 0;
@@ -1123,14 +1123,14 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s
struct sockaddr_in6 *sa6_dst = _pmtu->ro_dst;
 
if (!rtisvalid(ro_pmtu->ro_rt) ||
-   (ro_pmtu->ro_tableid != ifp->if_rdomain) ||
+   (ro_pmtu->ro_tableid != rtableid) ||
 !IN6_ARE_ADDR_EQUAL(_dst->sin6_addr, dst)) {
rtfree(ro_pmtu->ro_rt);
ro_pmtu->ro_rt = NULL;
}
if (ro_pmtu->ro_rt == NULL) {
bzero(ro_pmtu, sizeof(*ro_pmtu));
-   ro_pmtu->ro_tableid = ifp->if_rdomain;
+   ro_pmtu->ro_tableid = rtableid;
sa6_dst->sin6_family = AF_INET6;
sa6_dst->sin6_len = sizeof(struct sockaddr_in6);
sa6_dst->sin6_addr = *dst;
@@ -1140,8 +1140,13 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s
}
}
if (ro_pmtu->ro_rt) {
-   if (ifp == NULL)
-   ifp = ro_pmtu->ro_rt->rt_ifp;
+   struct ifnet *ifp;
+
+   if (ifp0 == NULL)
+   ifp = if_get(ro_pmtu->ro_rt->rt_ifidx);
+   else
+   ifp = ifp0;
+
mtu = ro_pmtu->ro_rt->rt_rmx.rmx_mtu;
if (mtu == 0)
mtu = ifp->if_mtu;
@@ -1169,8 +1174,11 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s
if (!(ro_pmtu->ro_rt->rt_rmx.rmx_locks & RTV_MTU))
ro_pmtu->ro_rt->rt_rmx.rmx_mtu = mtu;
}
-   } else if (ifp) {
-   mtu = ifp->if_mtu;
+
+   if (ifp0 == NULL)
+   if_put(ifp);
+   } else if (ifp0) {
+   mtu = ifp0->if_mtu;
} else
error = EHOSTUNREACH; /* XXX */
 
@@ -1623,7 +1631,8 @@ do { \
 * the outgoing interface.
 */
error = ip6_getpmtu(ro, NULL, NULL,
-   >inp_faddr6, , NULL);
+   inp->inp_rtableid, >inp_faddr6, ,
+   NULL);
if (error)
break;
if (pmtu > IPV6_MAXPACKET)