Page MenuHomeFreeBSD

D62412.1796435700.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62412.1796435700.diff

diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -36,6 +36,7 @@
* SUCH DAMAGE.
*/
+#include "opt_bootp.h"
#include "opt_ddb.h"
#include "opt_ipsec.h"
#include "opt_inet.h"
@@ -1279,9 +1280,13 @@
}
/*
- * Do proper source address selection on an unbound socket in case
- * of connect. Take jails into account as well.
+ * Do proper source address selection on an unbound socket in case of
+ * connect(2). Take jails into account as well.
+ * Do not permit sending from 0.0.0.0, with an exclusion for the kernel BOOTP.
*/
+#ifdef BOOTP
+extern struct socket *bootp_so;
+#endif
int
in_pcbladdr(const struct inpcb *inp, struct in_addr *faddr,
struct in_addr *laddr, struct ucred *cred)
@@ -1505,7 +1510,11 @@
}
done:
- if (error == 0 && laddr->s_addr == INADDR_ANY)
+ if (error == 0 &&
+#ifdef BOOTP
+ inp->inp_socket != bootp_so &&
+#endif
+ laddr->s_addr == INADDR_ANY)
return (EHOSTUNREACH);
return (error);
}
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c
--- a/sys/nfs/bootp_subr.c
+++ b/sys/nfs/bootp_subr.c
@@ -235,7 +235,7 @@
#endif
static char bootp_cookie[128];
-static struct socket *bootp_so;
+struct socket *bootp_so;
SYSCTL_STRING(_kern, OID_AUTO, bootp_cookie, CTLFLAG_RD,
bootp_cookie, 0, "Cookie (T134) supplied by bootp server");

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 5, 1:55 AM (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42216884
Default Alt Text
D62412.1796435700.diff (1 KB)

Event Timeline