summaryrefslogtreecommitdiffstats
path: root/sbin/natd
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2016-06-28 20:10:30 +0000
committerphk <phk@FreeBSD.org>2016-06-28 20:10:30 +0000
commit8c8129e2bd32aa12f7531eeb6dd4a77fe81b715e (patch)
tree782de1ccf2240c883d57f1020802003426c6e1a4 /sbin/natd
parenta88a58d887c3a07b1e4c9ad3a4eb818bc4534247 (diff)
downloadFreeBSD-src-8c8129e2bd32aa12f7531eeb6dd4a77fe81b715e.zip
FreeBSD-src-8c8129e2bd32aa12f7531eeb6dd4a77fe81b715e.tar.gz
Do not coredump if the packet is too long in the global (non-interface
associated) instance. The result is that the packet is dropped without an indication that smaller MTU is advisable, which is not optimal, but better than a NULL pointer deref. Approved by: re (glebius)
Diffstat (limited to 'sbin/natd')
-rw-r--r--sbin/natd/natd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c
index 894e824..aa1628a 100644
--- a/sbin/natd/natd.c
+++ b/sbin/natd/natd.c
@@ -618,7 +618,7 @@ static void DoGlobal (int fd)
if (wrote != bytes) {
- if (errno == EMSGSIZE) {
+ if (errno == EMSGSIZE && mip != NULL) {
if (mip->ifMTU != -1)
SendNeedFragIcmp (icmpSock,
OpenPOWER on IntegriCloud