1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

Check -s option source address for validity.

PR:		bin/29026
MFC after:	1 week
This commit is contained in:
Pierre Beyssac 2004-04-17 18:44:23 +00:00
parent 4f31891e2d
commit bc5cfff933
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128365

View File

@ -880,13 +880,13 @@ main(int argc, char **argv)
}
outip->ip_src = from->sin_addr;
#ifndef IP_HDRINCL
/* Check the source address (-s), if any, is valid */
if (bind(sndsock, (struct sockaddr *)from, sizeof(*from)) < 0) {
Fprintf(stderr, "%s: bind: %s\n",
prog, strerror(errno));
exit (1);
}
#endif
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
if (setpolicy(sndsock, "in bypass") < 0)