NetBSD Problem Report #51388

From www@NetBSD.org  Fri Aug  5 10:26:09 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7AC0F7A13F
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  5 Aug 2016 10:26:09 +0000 (UTC)
Message-Id: <20160805102608.884437A2AB@mollari.NetBSD.org>
Date: Fri,  5 Aug 2016 10:26:08 +0000 (UTC)
From: zafer@netbsd.org
Reply-To: zafer@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: IPv4 with 31 bit netmasks and RFC 3021
X-Send-Pr-Version: www-1.0

>Number:         51388
>Category:       kern
>Synopsis:       IPv4 with 31 bit netmasks and RFC 3021
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 05 10:30:00 +0000 2016
>Closed-Date:    Tue May 05 11:16:14 +0000 2020
>Last-Modified:  Tue May 05 11:16:14 +0000 2020
>Originator:     Zafer Aydogan
>Release:        7.0
>Organization:
TNF
>Environment:
amd64
>Description:
While deploying a server at a cloud provider, I noticed that the provider only serves /31 networks via dhcp. This left me disconnected with the internet, because the gateway was on the subnet ip.

NetBSD's behaviour is correct, but there is an RFC 3021 that is widely adopted that allows to work with 31 bit netmasks which mitigates the lack of IPv4 addresses.




>How-To-Repeat:
Create a network where the router is on the subnet ip of a 31 bit netmask.
Then try to reach the router.

>Fix:
Please adopt RFC 3021:
https://tools.ietf.org/html/rfc3021

The changes are minimal:

https://secure.freshbsd.org/commit/freebsd/r226402?diff=head%2Fsys%2Fnetinet%2Fin.c


>Release-Note:

>Audit-Trail:
From: "Roy Marples" <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51388 CVS commit: src/sys/netinet
Date: Wed, 18 Dec 2019 00:49:16 +0000

 Module Name:	src
 Committed By:	roy
 Date:		Wed Dec 18 00:49:16 UTC 2019

 Modified Files:
 	src/sys/netinet: in.c in.h

 Log Message:
 inet: Add support for IPv4 /31 prefixes, as described in RFC 3021.

 To run a /31 network, participating hosts MUST drop support
 for directed broadcasts, and treat the first and last addresses
 on subnet as unicast. The broadcast address for the prefix
 should be the link local broadcast address, INADDR_BROADCAST.

 Taken from FreeBSD, r226402.
 Fixes PR kern/51388.


 To generate a diff of this commit:
 cvs rdiff -u -r1.235 -r1.236 src/sys/netinet/in.c
 cvs rdiff -u -r1.108 -r1.109 src/sys/netinet/in.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 21 Apr 2020 17:11:19 +0000
State-Changed-Why:
Is the fix satisfactory?


From: =?UTF-8?Q?Zafer_Aydo=C4=9Fan?= <zafer@aydogan.de>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, 
	maya@netbsd.org
Subject: Re: kern/51388 (IPv4 with 31 bit netmasks and RFC 3021)
Date: Tue, 5 May 2020 09:16:47 +0200

 Yes !
 Thank you Roy !
 Thank you Maya!

 <maya@netbsd.org> adresine sahip kullan=C4=B1c=C4=B1 21 Nis 2020 Sal, 19:11
 tarihinde =C5=9Funu yazd=C4=B1:
 >
 > Synopsis: IPv4 with 31 bit netmasks and RFC 3021
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: maya@NetBSD.org
 > State-Changed-When: Tue, 21 Apr 2020 17:11:19 +0000
 > State-Changed-Why:
 > Is the fix satisfactory?
 >
 >
 >

State-Changed-From-To: feedback->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 05 May 2020 11:16:14 +0000
State-Changed-Why:
Fixed by roy, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.