Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Matt Layher <mdlayher@gmail.com>
To: wireguard@lists.zx2c4.com
Subject: Use of __kernel_timespec in userspace genetlink API
Date: Thu, 18 Apr 2019 10:06:17 -0400	[thread overview]
Message-ID: <f87c87a0-c5b4-9ee8-ba28-9ff575987f72@gmail.com> (raw)

Hey all,

I recently received a bug report for 
https://github.com/mdlayher/wireguardctrl which indicated that the 
timespec structure being returned from the WireGuard genetlink API was 
not of the expected size on a 32-bit machine.

It then occurred to us that the userspace-facing API is returning a 
"__kernel_timespec"; something I did not realize before:

https://git.zx2c4.com/WireGuard/tree/src/uapi/wireguard.h?id=91b0a211861d487382a534572844ff29839064f1#n38
https://git.zx2c4.com/WireGuard/tree/src/netlink.c?id=91b0a211861d487382a534572844ff29839064f1#n112

My C experience is very limited, and I have no experience working on C 
within the kernel, but is exposing a "__kernel*" type to userspace a 
normal procedure? I would have expected to see a regular timespec from 
linux/time.h, or perhaps a timespec64 in its place.

I can do some slightly more intelligent checking to fix the current 
issue with my library, but I wanted to check in and confirm that this 
API contract is correct.

Thanks for your time!
- Matt Layher

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

             reply	other threads:[~2019-04-18 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 14:06 Matt Layher [this message]
2019-04-22 18:13 ` Tharre
2019-04-22 23:35   ` Ryan Whelan
2019-04-22 23:48     ` Tharre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f87c87a0-c5b4-9ee8-ba28-9ff575987f72@gmail.com \
    --to=mdlayher@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).