Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178291383
D62412.1796445602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62412.1796445602.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 5, 4:40 AM (23 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42216884
Default Alt Text
D62412.1796445602.diff (1 KB)
Attached To
Mode
D62412: inpcb: in in_pcbladdr() make an exclusion for kernel BOOTP client
Attached
Detach File
Event Timeline