All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] IB/ipoib: Expose ioctl command to retrieve SGID of a given socket
Date: Thu, 31 Dec 2015 17:31:44 +0200	[thread overview]
Message-ID: <56854A60.6040202@mellanox.com> (raw)
In-Reply-To: <1451572875-24961-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

On 12/31/2015 4:41 PM, Yuval Shaia wrote:
> To support security applications, that need to filter out connections based
> on SGID, an ioctl command to retrieve SGID of a given socket is added.
[...]

+
+found:
+	if (!(neigh->nud_state & NUD_VALID))
+		return -EINVAL;
+
+	gid = (union ib_gid *)(neigh->ha + 4);
+	*sgid = be64_to_cpu(gid->global.interface_id);
+	*subnet_prefix = be64_to_cpu(gid->global.subnet_prefix);


wait (1st)

the neighbour holds a destination address, not source address, so why 
are you talking on SGID?!

wait (2nd)

what prevents you from getting this info in user space through netlink 
from the kernel rtnl routing/neighbour services?

> root@r-dcs54 ~]# ip r s  | grep 192.168.20.0/24
> 192.168.20.0/24 dev ib0  proto kernel  scope link  src 192.168.20.17

> [root@r-dcs54 ~]# ip n s  | grep ib0
> 192.168.20.18 dev ib0 lladdr 
> 80:00:00:48:fe:80:00:00:00:00:00:00:f4:52:14:03:00:01:da:81 DELAY


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-31 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31 14:41 [PATCH] IB/ipoib: Expose ioctl command to retrieve SGID of a given socket Yuval Shaia
     [not found] ` <1451572875-24961-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-12-31 15:31   ` Or Gerlitz [this message]
     [not found]     ` <56854A60.6040202-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-03  7:53       ` Yuval Shaia
2015-12-31 15:34   ` Haggai Eran
     [not found]     ` <56854AEB.50802-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-03  7:52       ` Yuval Shaia
2016-01-06 11:03       ` Yuval Shaia
2016-01-06 12:25         ` Haggai Eran
     [not found]           ` <568D07D0.8080404-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-06 13:10             ` Yuval Shaia
2016-01-19 21:06               ` Doug Ledford

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=56854A60.6040202@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.