Check -s option source address for validity.
PR: bin/29026 MFC after: 1 week
This commit is contained in:
parent
5cf84135c6
commit
0333af10cb
@ -880,13 +880,13 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
outip->ip_src = from->sin_addr;
|
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) {
|
if (bind(sndsock, (struct sockaddr *)from, sizeof(*from)) < 0) {
|
||||||
Fprintf(stderr, "%s: bind: %s\n",
|
Fprintf(stderr, "%s: bind: %s\n",
|
||||||
prog, strerror(errno));
|
prog, strerror(errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
|
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
|
||||||
if (setpolicy(sndsock, "in bypass") < 0)
|
if (setpolicy(sndsock, "in bypass") < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user