public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Add INADDR_DUMMY from Linux 5.13 to netinet/in.h
@ 2021-08-05 20:05 Joseph Myers
  2021-08-05 20:12 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2021-08-05 20:05 UTC (permalink / raw)
  To: libc-alpha

Linux 5.13 adds an INADDR_DUMMY definition; add a corresponding
definition to glibc's netinet/in.h.  (This isn't strictly a new kernel
interface, rather a value defined in RFC 7600.)

Tested for x86_64.

diff --git a/inet/netinet/in.h b/inet/netinet/in.h
index ed21690afb..cee35efec9 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -196,6 +196,9 @@ enum
 #define	INADDR_BROADCAST	((in_addr_t) 0xffffffff)
 /* Address indicating an error return.  */
 #define	INADDR_NONE		((in_addr_t) 0xffffffff)
+/* Dummy address for source of ICMPv6 errors converted to IPv4 (RFC
+   7600).  */
+#define	INADDR_DUMMY		((in_addr_t) 0xc0000008)
 
 /* Network number for local host loopback.  */
 #define	IN_LOOPBACKNET		127

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Add INADDR_DUMMY from Linux 5.13 to netinet/in.h
  2021-08-05 20:05 Add INADDR_DUMMY from Linux 5.13 to netinet/in.h Joseph Myers
@ 2021-08-05 20:12 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2021-08-05 20:12 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

* Joseph Myers:

> Linux 5.13 adds an INADDR_DUMMY definition; add a corresponding
> definition to glibc's netinet/in.h.  (This isn't strictly a new kernel
> interface, rather a value defined in RFC 7600.)
>
> Tested for x86_64.
>
> diff --git a/inet/netinet/in.h b/inet/netinet/in.h
> index ed21690afb..cee35efec9 100644
> --- a/inet/netinet/in.h
> +++ b/inet/netinet/in.h
> @@ -196,6 +196,9 @@ enum
>  #define	INADDR_BROADCAST	((in_addr_t) 0xffffffff)
>  /* Address indicating an error return.  */
>  #define	INADDR_NONE		((in_addr_t) 0xffffffff)
> +/* Dummy address for source of ICMPv6 errors converted to IPv4 (RFC
> +   7600).  */
> +#define	INADDR_DUMMY		((in_addr_t) 0xc0000008)
>  
>  /* Network number for local host loopback.  */
>  #define	IN_LOOPBACKNET		127

I checked that the value matches RFC 7600 (192.0.0.8).  Looks good.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-05 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 20:05 Add INADDR_DUMMY from Linux 5.13 to netinet/in.h Joseph Myers
2021-08-05 20:12 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).