lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 30 May 2015 21:52:23 +0200
From:	Frans Klaver <fransklaver@...il.com>
To:	Mikko Rapeli <mikko.rapeli@....fi>
Cc:	linux-kernel@...r.kernel.org, linux-api@...r.kernel.org
Subject: Re: [PATCH 49/98] Break dependency loop between linux/if.h and
 linux/hdlc/ioctl.h

On Sat, May 30, 2015 at 05:38:41PM +0200, Mikko Rapeli wrote:
> This isn't pretty but does the job. I assume including plain linux/hdlc/ioctl.h
> without linux/if.h is much more rare than the other way round, and that
> these header file names are part of API, and that creating a new header file
> just for IFNAMSIZ isn't a good idea either.
> 
> Fixes userspace compiler error:
> 
> error: ‘IFNAMSIZ’ undeclared here (not in a function)
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@....fi>
> ---
>  include/uapi/linux/hdlc/ioctl.h | 5 ++++-
>  include/uapi/linux/if.h         | 4 ++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h
> index 8bbee11..73982ec 100644
> --- a/include/uapi/linux/hdlc/ioctl.h
> +++ b/include/uapi/linux/hdlc/ioctl.h
> @@ -1,7 +1,10 @@
>  #ifndef __HDLC_IOCTL_H__
>  #define __HDLC_IOCTL_H__
>  
> -#include <linux/if.h>
> +/* For breaking dependency loop between if.h and hdlc/ioctl.h */
> +#ifndef IFNAMSIZ
> +#define IFNAMSIZ        16
> +#endif
>  
>  #define GENERIC_HDLC_VERSION 4	/* For synchronization with sethdlc utility */
>  
> diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
> index 9cf2394..e4b130a 100644
> --- a/include/uapi/linux/if.h
> +++ b/include/uapi/linux/if.h
> @@ -23,6 +23,10 @@
>  #include <linux/socket.h>		/* for "struct sockaddr" et al	*/
>  #include <linux/compiler.h>		/* for "__user" et al           */
>  
> +/**
> + * IFNAMSIZ is also defined in linux/hdlc/ioctl.h if it does not exists
> + * to break dependency loop between linux/if.h and linux/hdlc/ioctl.h.
> + */
>  #define	IFNAMSIZ	16
>  #define	IFALIASZ	256
>  #include <linux/hdlc/ioctl.h>

This feels backwards to me. Wouldn't it be less funky to accept that
IFNAMSIZE isn't defined in if.h, but rather in hdlc/ioctl.h? If now
someone feels giddy and does

#include <linux/hdlc/ioctl.h>
#include <linux/if.h>

We have a new and unnecessary warning on our hands ;-)

Thanks,
Frans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ