summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/npppd/npppd/npppd_subr.c4
-rw-r--r--usr.sbin/npppd/pppoe/pppoe_session.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/npppd/npppd/npppd_subr.c b/usr.sbin/npppd/npppd/npppd_subr.c
index c391419e868..db9877decb6 100644
--- a/usr.sbin/npppd/npppd/npppd_subr.c
+++ b/usr.sbin/npppd/npppd/npppd_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppd_subr.c,v 1.16 2015/01/19 01:48:59 deraadt Exp $ */
+/* $OpenBSD: npppd_subr.c,v 1.17 2015/09/13 08:22:10 mpi Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -29,6 +29,7 @@
* This file provides helper functions for npppd.
*/
+#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
@@ -216,6 +217,7 @@ in_route0(int type, struct in_addr *dest, struct in_addr *mask,
strlcpy(sdl->sdl_data, ifname, IFNAMSIZ);
sdl->sdl_family = AF_LINK;
sdl->sdl_len = offsetof(struct sockaddr_dl, sdl_data) +IFNAMSIZ;
+ sdl->sdl_index = if_nametoindex(ifname);
memcpy(cp, sdl, sdl->sdl_len);
cp += ROUNDUP(sdl->sdl_len);
}
diff --git a/usr.sbin/npppd/pppoe/pppoe_session.c b/usr.sbin/npppd/pppoe/pppoe_session.c
index 676b60cc990..213712b4474 100644
--- a/usr.sbin/npppd/pppoe/pppoe_session.c
+++ b/usr.sbin/npppd/pppoe/pppoe_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppoe_session.c,v 1.9 2015/01/19 01:48:59 deraadt Exp $ */
+/* $OpenBSD: pppoe_session.c,v 1.10 2015/09/13 08:22:10 mpi Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -28,7 +28,7 @@
/**@file
* Session management of PPPoE protocol
- * $Id: pppoe_session.c,v 1.9 2015/01/19 01:48:59 deraadt Exp $
+ * $Id: pppoe_session.c,v 1.10 2015/09/13 08:22:10 mpi Exp $
*/
#include <sys/types.h>
@@ -503,6 +503,7 @@ pppoe_session_bind_ppp(pppoe_session *_this)
memset(&sdl, 0, sizeof(sdl));
sdl.sdl_len = sizeof(sdl);
sdl.sdl_family = AF_LINK;
+ sdl.sdl_index = if_nametoindex(pppoe_session_listen_ifname(_this));
len = strlen(pppoe_session_listen_ifname(_this));
memcpy(sdl.sdl_data, pppoe_session_listen_ifname(_this), len);
sdl.sdl_nlen = len;