diff mbox series

[PATCHv2] Move ip_mreqn structure from Linux to generic

Message ID 20220815171550.1747664-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [PATCHv2] Move ip_mreqn structure from Linux to generic | expand

Commit Message

Samuel Thibault Aug. 15, 2022, 5:15 p.m. UTC
I.e. from sysdeps/unix/sysv/linux/bits/in.h to netinet/in.h

It is following both the BSD and Linux definitions.
---
 inet/netinet/in.h                 | 13 +++++++++++++
 sysdeps/unix/sysv/linux/bits/in.h |  8 --------
 2 files changed, 13 insertions(+), 8 deletions(-)

Comments

Florian Weimer Aug. 15, 2022, 7:58 p.m. UTC | #1
* Samuel Thibault:

> I.e. from sysdeps/unix/sysv/linux/bits/in.h to netinet/in.h
>
> It is following both the BSD and Linux definitions.
> ---
>  inet/netinet/in.h                 | 13 +++++++++++++
>  sysdeps/unix/sysv/linux/bits/in.h |  8 --------
>  2 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/inet/netinet/in.h b/inet/netinet/in.h
> index 1633bc64e4..362eb9e9e7 100644
> --- a/inet/netinet/in.h
> +++ b/inet/netinet/in.h
> @@ -278,6 +278,19 @@ struct ip_mreq
>      struct in_addr imr_interface;
>    };
>  
> +/* IPv4 multicast request with interface index.  */
> +struct ip_mreqn
> +  {
> +    /* IP multicast address of group.  */
> +    struct in_addr imr_multiaddr;
> +
> +    /* Local IP address of interface.  */
> +    struct in_addr imr_address;
> +
> +    /* Interface index.  */
> +    int imr_ifindex;
> +  };
> +
>  struct ip_mreq_source
>    {
>      /* IP multicast address of group.  */
> diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
> index af6898a5ce..00d10d812c 100644
> --- a/sysdeps/unix/sysv/linux/bits/in.h
> +++ b/sysdeps/unix/sysv/linux/bits/in.h
> @@ -146,14 +146,6 @@ struct ip_opts
>      char ip_opts[40];		/* Actually variable in size.  */
>    };
>  
> -/* Like `struct ip_mreq' but including interface specification by index.  */
> -struct ip_mreqn
> -  {
> -    struct in_addr imr_multiaddr;	/* IP multicast address of group */
> -    struct in_addr imr_address;		/* local IP address of interface */
> -    int	imr_ifindex;			/* Interface index */
> -  };
> -
>  /* Structure used for IP_PKTINFO.  */
>  struct in_pktinfo
>    {

This version looks okay to me.  Same definition, still under __USE_MISC.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian
Samuel Thibault Aug. 15, 2022, 8:44 p.m. UTC | #2
Florian Weimer, le lun. 15 août 2022 21:58:39 +0200, a ecrit:
> * Samuel Thibault:
> 
> > I.e. from sysdeps/unix/sysv/linux/bits/in.h to netinet/in.h
> >
> > It is following both the BSD and Linux definitions.
> > ---
> >  inet/netinet/in.h                 | 13 +++++++++++++
> >  sysdeps/unix/sysv/linux/bits/in.h |  8 --------
> >  2 files changed, 13 insertions(+), 8 deletions(-)
> >
> > diff --git a/inet/netinet/in.h b/inet/netinet/in.h
> > index 1633bc64e4..362eb9e9e7 100644
> > --- a/inet/netinet/in.h
> > +++ b/inet/netinet/in.h
> > @@ -278,6 +278,19 @@ struct ip_mreq
> >      struct in_addr imr_interface;
> >    };
> >  
> > +/* IPv4 multicast request with interface index.  */
> > +struct ip_mreqn
> > +  {
> > +    /* IP multicast address of group.  */
> > +    struct in_addr imr_multiaddr;
> > +
> > +    /* Local IP address of interface.  */
> > +    struct in_addr imr_address;
> > +
> > +    /* Interface index.  */
> > +    int imr_ifindex;
> > +  };
> > +
> >  struct ip_mreq_source
> >    {
> >      /* IP multicast address of group.  */
> > diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
> > index af6898a5ce..00d10d812c 100644
> > --- a/sysdeps/unix/sysv/linux/bits/in.h
> > +++ b/sysdeps/unix/sysv/linux/bits/in.h
> > @@ -146,14 +146,6 @@ struct ip_opts
> >      char ip_opts[40];		/* Actually variable in size.  */
> >    };
> >  
> > -/* Like `struct ip_mreq' but including interface specification by index.  */
> > -struct ip_mreqn
> > -  {
> > -    struct in_addr imr_multiaddr;	/* IP multicast address of group */
> > -    struct in_addr imr_address;		/* local IP address of interface */
> > -    int	imr_ifindex;			/* Interface index */
> > -  };
> > -
> >  /* Structure used for IP_PKTINFO.  */
> >  struct in_pktinfo
> >    {
> 
> This version looks okay to me.  Same definition, still under __USE_MISC.
> 
> Reviewed-by: Florian Weimer <fweimer@redhat.com>

Pushed, thanks!
diff mbox series

Patch

diff --git a/inet/netinet/in.h b/inet/netinet/in.h
index 1633bc64e4..362eb9e9e7 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -278,6 +278,19 @@  struct ip_mreq
     struct in_addr imr_interface;
   };
 
+/* IPv4 multicast request with interface index.  */
+struct ip_mreqn
+  {
+    /* IP multicast address of group.  */
+    struct in_addr imr_multiaddr;
+
+    /* Local IP address of interface.  */
+    struct in_addr imr_address;
+
+    /* Interface index.  */
+    int imr_ifindex;
+  };
+
 struct ip_mreq_source
   {
     /* IP multicast address of group.  */
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index af6898a5ce..00d10d812c 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -146,14 +146,6 @@  struct ip_opts
     char ip_opts[40];		/* Actually variable in size.  */
   };
 
-/* Like `struct ip_mreq' but including interface specification by index.  */
-struct ip_mreqn
-  {
-    struct in_addr imr_multiaddr;	/* IP multicast address of group */
-    struct in_addr imr_address;		/* local IP address of interface */
-    int	imr_ifindex;			/* Interface index */
-  };
-
 /* Structure used for IP_PKTINFO.  */
 struct in_pktinfo
   {