diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 2f3be91df450..c4ddb20b7ea3 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,4 +1,4 @@ -/* $NetBSD: ping6.c,v 1.88 2015/08/06 14:45:54 ozaki-r Exp $ */ +/* $NetBSD: ping6.c,v 1.89 2015/11/04 01:14:02 knakahara Exp $ */ /* $KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $ */ /* @@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; #else #include #ifndef lint -__RCSID("$NetBSD: ping6.c,v 1.88 2015/08/06 14:45:54 ozaki-r Exp $"); +__RCSID("$NetBSD: ping6.c,v 1.89 2015/11/04 01:14:02 knakahara Exp $"); #endif #endif @@ -636,7 +636,7 @@ main(int argc, char *argv[]) /* set the source address if specified. */ if ((options & F_SRCADDR) && - bind(s, (struct sockaddr *)&src, srclen) != 0) { + prog_bind(s, (struct sockaddr *)&src, srclen) != 0) { err(1, "bind"); } diff --git a/sbin/ping6/ping6_hostops.c b/sbin/ping6/ping6_hostops.c index 4c1d1c25e0b8..097eb161435b 100644 --- a/sbin/ping6/ping6_hostops.c +++ b/sbin/ping6/ping6_hostops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ping6_hostops.c,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $ */ +/* $NetBSD: ping6_hostops.c,v 1.2 2015/11/04 01:14:02 knakahara Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ping6_hostops.c,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $"); +__RCSID("$NetBSD: ping6_hostops.c,v 1.2 2015/11/04 01:14:02 knakahara Exp $"); #endif /* !lint */ #include @@ -42,6 +42,7 @@ __RCSID("$NetBSD: ping6_hostops.c,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $"); const struct prog_ops prog_ops = { .op_socket = socket, + .op_bind = bind, .op_setsockopt = setsockopt, .op_getsockname = getsockname, .op_poll = poll, diff --git a/sbin/ping6/ping6_rumpops.c b/sbin/ping6/ping6_rumpops.c index 672135aef459..c0ad1b03ebd7 100644 --- a/sbin/ping6/ping6_rumpops.c +++ b/sbin/ping6/ping6_rumpops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ping6_rumpops.c,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $ */ +/* $NetBSD: ping6_rumpops.c,v 1.2 2015/11/04 01:14:02 knakahara Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ping6_rumpops.c,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $"); +__RCSID("$NetBSD: ping6_rumpops.c,v 1.2 2015/11/04 01:14:02 knakahara Exp $"); #endif /* !lint */ #include @@ -47,6 +47,7 @@ const struct prog_ops prog_ops = { .op_init = rumpclient_init, .op_socket = rump_sys_socket, + .op_bind = rump_sys_bind, .op_setsockopt= rump_sys_setsockopt, .op_getsockname=rump_sys_getsockname, .op_poll = rump_sys_poll, diff --git a/sbin/ping6/prog_ops.h b/sbin/ping6/prog_ops.h index 144e9d10bbff..4c99fe2493f0 100644 --- a/sbin/ping6/prog_ops.h +++ b/sbin/ping6/prog_ops.h @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.1 2015/08/06 14:45:54 ozaki-r Exp $ */ +/* $NetBSD: prog_ops.h,v 1.2 2015/11/04 01:14:02 knakahara Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ struct prog_ops { int (*op_init)(void); int (*op_socket)(int, int, int); + int (*op_bind)(int, const struct sockaddr *, socklen_t); int (*op_setsockopt)(int, int, int, const void *, socklen_t); int (*op_getsockname)(int, struct sockaddr * restrict, socklen_t * restrict); @@ -56,6 +57,7 @@ extern const struct prog_ops prog_ops; #define prog_init prog_ops.op_init #define prog_socket prog_ops.op_socket +#define prog_bind prog_ops.op_bind #define prog_setsockopt prog_ops.op_setsockopt #define prog_getsockname prog_ops.op_getsockname #define prog_shutdown prog_ops.op_shutdown @@ -70,6 +72,7 @@ extern const struct prog_ops prog_ops; #else #define prog_init ((int (*)(void))NULL) #define prog_socket socket +#define prog_bind bind #define prog_setsockopt setsockopt #define prog_getsockname getsockname #define prog_shutdown shutdown